diff --git a/grade/report/grader/preferences_form.php b/grade/report/grader/preferences_form.php
index <HASH>..<HASH> 100644
--- a/grade/report/grader/preferences_form.php
+++ b/grade/report/grader/preferences_form.php
@@ -153,6 +153,7 @@ class grader_report_preferences_form extends moodleform {
                     $type = 'select';
                     // MDL-11478
                     // get default aggregationposition from grade_settings
+                    $course_value = null;
                     if (!empty($CFG->{$full_pref})) {
                         $course_value = grade_get_setting($course->id, $pref, $CFG->{$full_pref});
                     }
MDL-<I> Fixed an undefined variable ($course_value). Merged from MOODLE_<I>_STABLE