Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-36712: Assignment grading with custom scale is affected by the cu…

…rrent language
  • Loading branch information...
commit dba42c33905414a0ff278ce78464b5f9d87e9506 1 parent c41d292
@damyon damyon authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 mod/assign/locallib.php
View
5 mod/assign/locallib.php
@@ -2974,6 +2974,11 @@ public function add_grade_form_elements(MoodleQuickForm $mform, stdClass $data,
$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();
Please sign in to comment.
Something went wrong with that request. Please try again.