MDL-13579 Reduced the setting to 3 locations. Merging from MOODLE_19_STABLE

This commit is contained in:
nicolasconnault 2008-02-27 07:29:31 +00:00
parent ffcd3023e1
commit a2342ad3f0
3 changed files with 5 additions and 9 deletions

View 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);
}

View 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 = '';

View 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'),