]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-13579 Reduced the setting to 3 locations. Merging from MOODLE_19_STABLE
authornicolasconnault <nicolasconnault>
Wed, 27 Feb 2008 07:29:31 +0000 (07:29 +0000)
committernicolasconnault <nicolasconnault>
Wed, 27 Feb 2008 07:29:31 +0000 (07:29 +0000)
grade/report/grader/lib.php
grade/report/grader/preferences_form.php
grade/report/grader/settings.php

index 119a0d453eed4a54c42b0fd3adaec33bcad84a4d..30de950d5fe2bdb65a78ca6abb99f1cbcea88aa2 100644 (file)
@@ -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);
         }
 
index e59c851ed22459a8cb0dd87a1eb300fa4ba8d81b..797c9781fb1b9cce00077e6522e23e79370e19ec 100644 (file)
@@ -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 = '';
index bd9b7117cc2f59617c077a466ef0a9ba8c3bcee7..5c0149bf83e7e89f908b6ab6b09dd2a1fa0eaef8 100644 (file)
@@ -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'),