MDL-17226 Hiding the group show/hide settings and toggle for grader report. Merging from MOODLE_19_STABLE

This commit is contained in:
nicolasconnault
2008-11-13 15:44:01 +00:00
parent 740366f446
commit 7f304262ba
2 changed files with 7 additions and 4 deletions
+2 -2
View File
@@ -400,7 +400,7 @@ class grade_report_grader extends grade_report {
* @return string HTML code
*/
public function get_toggles_html() {
global $CFG, $USER;
global $CFG, $USER, $COURSE;
$html = '<div id="grade-report-toggles">';
if ($USER->gradeediting[$this->courseid]) {
@@ -427,7 +427,7 @@ class grade_report_grader extends grade_report {
if (has_capability('moodle/grade:viewall', $this->context)
and has_capability('moodle/site:accessallgroups', $this->context)
and $course_has_groups = true) { // TODO replace that last condition with proper check
and $COURSE->groupmode != NOGROUPS) { // TODO replace that last condition with proper check
$html .= $this->print_toggle('groups', true);
}
+5 -2
View File
@@ -72,7 +72,10 @@ class grader_report_preferences_form extends moodleform {
if ($canviewhidden) {
$preferences['prefshow']['showaverages'] = $checkbox_default;
}
$preferences['prefshow']['showgroups'] = $checkbox_default;
if ($course->groupmode != NOGROUPS) {
$preferences['prefshow']['showgroups'] = $checkbox_default;
}
$preferences['prefshow']['showlocks'] = $checkbox_default;
$preferences['prefrows'] = array(
@@ -156,7 +159,7 @@ class grader_report_preferences_form extends moodleform {
if (!empty($CFG->{$full_pref})) {
$course_value = grade_get_setting($course->id, $pref, $CFG->{$full_pref});
}
if ($pref == 'aggregationposition') {
if (!empty($options[$course_value])) {
$default = $options[$course_value];