From a2342ad3f076991e551e81c66d015acc434874ca Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Wed, 27 Feb 2008 07:29:31 +0000 Subject: [PATCH] MDL-13579 Reduced the setting to 3 locations. Merging from MOODLE_19_STABLE --- grade/report/grader/lib.php | 2 +- grade/report/grader/preferences_form.php | 6 ++++-- grade/report/grader/settings.php | 6 ------ 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/grade/report/grader/lib.php b/grade/report/grader/lib.php index 119a0d453e..30de950d5f 100644 --- a/grade/report/grader/lib.php +++ b/grade/report/grader/lib.php @@ -114,7 +114,7 @@ class grade_report_grader extends grade_report { // if user report preference set or site report setting set use it, otherwise use course or site setting $switch = $this->get_pref('aggregationposition'); - if ($switch == GRADE_REPORT_PREFERENCE_INHERIT) { + if (empty($switch)) { $switch = grade_get_setting($this->courseid, 'aggregationposition', $CFG->grade_aggregationposition); } diff --git a/grade/report/grader/preferences_form.php b/grade/report/grader/preferences_form.php index e59c851ed2..797c9781fb 100644 --- a/grade/report/grader/preferences_form.php +++ b/grade/report/grader/preferences_form.php @@ -113,7 +113,6 @@ class grader_report_preferences_form extends moodleform { if (has_capability('gradereport/grader:view', $context)) { $preferences['prefgeneral']['studentsperpage'] = 'text'; $preferences['prefgeneral']['aggregationposition'] = array(GRADE_REPORT_PREFERENCE_DEFAULT => '*default*', - GRADE_REPORT_PREFERENCE_INHERIT => get_string('inherit', 'grades'), GRADE_REPORT_AGGREGATION_POSITION_FIRST => get_string('positionfirst', 'grades'), GRADE_REPORT_AGGREGATION_POSITION_LAST => get_string('positionlast', 'grades')); // $preferences['prefgeneral']['enableajax'] = $checkbox_default; @@ -153,7 +152,10 @@ class grader_report_preferences_form extends moodleform { $options = $type; $type = 'select'; // MDL-11478 - if (isset($options[$CFG->{$full_pref}])) { + // get default aggregationposition from grade_settings + if ($pref == 'aggregationposition') { + $default = $options[grade_get_setting($course->id, $pref, $CFG->{$full_pref})]; + } elseif (isset($options[$CFG->{$full_pref}])) { $default = $options[$CFG->{$full_pref}]; } else { $default = ''; diff --git a/grade/report/grader/settings.php b/grade/report/grader/settings.php index bd9b7117cc..5c0149bf83 100644 --- a/grade/report/grader/settings.php +++ b/grade/report/grader/settings.php @@ -39,12 +39,6 @@ $settings->add(new admin_setting_configcheckbox('grade_report_quickgrading', get $settings->add(new admin_setting_configcheckbox('grade_report_quickfeedback', get_string('quickfeedback', 'grades'), get_string('configquickfeedback', 'grades'), 1)); -$settings->add(new admin_setting_configselect('grade_report_aggregationposition', get_string('aggregationposition', 'grades'), - get_string('configaggregationposition', 'grades'), GRADE_REPORT_PREFERENCE_INHERIT, - array(GRADE_REPORT_PREFERENCE_INHERIT => $strinherit, - GRADE_REPORT_AGGREGATION_POSITION_FIRST => get_string('positionfirst', 'grades'), - GRADE_REPORT_AGGREGATION_POSITION_LAST => get_string('positionlast', 'grades')))); - $settings->add(new admin_setting_configselect('grade_report_aggregationview', get_string('aggregationview', 'grades'), get_string('configaggregationview', 'grades'), GRADE_REPORT_AGGREGATION_VIEW_FULL, array(GRADE_REPORT_AGGREGATION_VIEW_FULL => get_string('full', 'grades'), -- 2.39.5