diff --git a/admin/settings/grades.php b/admin/settings/grades.php index 122d0690aaf..f75df061da5 100644 --- a/admin/settings/grades.php +++ b/admin/settings/grades.php @@ -75,6 +75,7 @@ if (has_capability('moodle/grade:manage', $systemcontext) get_string('aggregateonlygradedhelp', 'grades'), $defaults, $options)); $temp->add(new admin_setting_gradecat_combo('grade_aggregateoutcomes', get_string('aggregateoutcomes', 'grades'), get_string('aggregateoutcomeshelp', 'grades'), $defaults, $options)); + $defaults = array('value'=>0, 'forced'=>false, 'adv'=>true); $temp->add(new admin_setting_gradecat_combo('grade_aggregatesubcats', get_string('aggregatesubcats', 'grades'), get_string('aggregatesubcatshelp', 'grades'), $defaults, $options)); diff --git a/lib/adminlib.php b/lib/adminlib.php index 068cd935a22..f38ad1166bc 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -3330,7 +3330,27 @@ class admin_setting_gradecat_combo extends admin_setting { $forced = !empty($data['forced']); $adv = !empty($data['adv']); - $return = ''; foreach ($this->choices as $key => $val) { // the string cast is needed because key may be integer - 0 is equal to most strings! $return .= ''; @@ -3340,8 +3360,9 @@ class admin_setting_gradecat_combo extends admin_setting { .''; $return .= '' .''; + $return .= ''; - return format_admin_setting($this, $this->visiblename, $return, $this->description, true, '', NULL, $query); + return format_admin_setting($this, $this->visiblename, $return, $this->description, true, '', $defaultinfo, $query); } }