MDL-13579 Corrected a bug in default value selection for the grader report preferences form.
This commit is contained in:
@@ -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 (empty($switch)) {
|
||||
if ($switch == '') {
|
||||
$switch = grade_get_setting($this->courseid, 'aggregationposition', $CFG->grade_aggregationposition);
|
||||
}
|
||||
|
||||
|
||||
@@ -153,8 +153,14 @@ class grader_report_preferences_form extends moodleform {
|
||||
$type = 'select';
|
||||
// MDL-11478
|
||||
// get default aggregationposition from grade_settings
|
||||
$course_value = grade_get_setting($course->id, $pref, $CFG->{$full_pref});
|
||||
|
||||
if ($pref == 'aggregationposition') {
|
||||
$default = $options[grade_get_setting($course->id, $pref, $CFG->{$full_pref})];
|
||||
if (!empty($options[$course_value])) {
|
||||
$default = $options[$course_value];
|
||||
} else {
|
||||
$default = $options[$CFG->grade_aggregationposition];
|
||||
}
|
||||
} elseif (isset($options[$CFG->{$full_pref}])) {
|
||||
$default = $options[$CFG->{$full_pref}];
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user