MDL-36712: Assignment grading with custom scale is affected by the current language
This commit is contained in:
committed by
Dan Poltawski
parent
9242214612
commit
4dbc9b0a64
@@ -3970,6 +3970,11 @@ class assign {
|
||||
$grademenu = make_grades_menu($this->get_instance()->grade);
|
||||
if (count($grademenu) > 0) {
|
||||
$gradingelement = $mform->addElement('select', 'grade', get_string('grade').':', $grademenu);
|
||||
|
||||
// The grade is already formatted with format_float so it needs to be converted back to an integer.
|
||||
if (!empty($data->grade)) {
|
||||
$data->grade = (int)unformat_float($data->grade);
|
||||
}
|
||||
$mform->setType('grade', PARAM_INT);
|
||||
if ($gradingdisabled) {
|
||||
$gradingelement->freeze();
|
||||
|
||||
Reference in New Issue
Block a user