Merge branch 'MDL-70034_master' of git://github.com/mdjnelson/moodle

This commit is contained in:
Sara Arjona 2021-01-11 15:19:22 +01:00
commit df8df7477c

View File

@ -657,8 +657,9 @@ class gradingform_guide_controller extends gradingform_controller {
}
$returnvalue['maxscore'] = $maxscore;
$returnvalue['minscore'] = 0;
if (!empty($this->moduleinstance->grade)) {
$graderange = make_grades_menu($this->moduleinstance->grade);
$fieldname = \core_grades\component_gradeitems::get_field_name_for_itemname($this->component, $this->area, 'grade');
if (!empty($this->moduleinstance->{$fieldname})) {
$graderange = make_grades_menu($this->moduleinstance->{$fieldname});
$returnvalue['modulegrade'] = count($graderange) - 1;
}
return $returnvalue;