Skip to content

Commit

Permalink
MDL-13579 Corrected a bug in default value selection for the grader r…
Browse files Browse the repository at this point in the history
…eport preferences form. Merging from MOODLE_19_STABLE
  • Loading branch information
nicolasconnault committed Feb 27, 2008
1 parent 73c32e8 commit 05766b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion grade/report/grader/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function grade_report_grader($courseid, $gpr, $context, $page=null, $sortitemid=

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

Expand Down
8 changes: 7 additions & 1 deletion grade/report/grader/preferences_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,14 @@ function definition() {
$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 {
Expand Down

0 comments on commit 05766b5

Please sign in to comment.