MDL-55519 activities: mform element shows correct maxgrade.
[moodle.git] / lib / form / modgrade.php
index 1be7cc8..6086f94 100644 (file)
@@ -503,7 +503,8 @@ class MoodleQuickForm_modgrade extends MoodleQuickForm_group {
                             $this->scaleformelement->setValue(($value * -1));
                         } else if ($value > 0) {
                             $this->gradetypeformelement->setValue('point');
-                            $this->maxgradeformelement->setValue($value);
+                            $maxvalue = !empty($this->currentgrade) ? (string)unformat_float($this->currentgrade) : $value;
+                            $this->maxgradeformelement->setValue($maxvalue);
                         }
                     } else {
                         $this->gradetypeformelement->setValue('none');