MDL-51899 mod/assign: Allow 0.00 grades while editing a grade.

The function unformat_float can return 0 and false.
We need to do strict comparison for the return value on line 92 to accept grades 0.00.
This commit is contained in:
Jakob
2015-11-04 11:10:44 -08:00
parent fb290224b0
commit 19ad96aee3
+1 -1
View File
@@ -89,7 +89,7 @@ class mod_assign_grade_form extends moodleform {
}
if ($instance->grade > 0) {
if (!unformat_float($data['grade'], true) && (!empty($data['grade']))) {
if (unformat_float($data['grade'], true) === false && (!empty($data['grade']))) {
$errors['grade'] = get_string('invalidfloatforgrade', 'assign', $data['grade']);
} else if (unformat_float($data['grade']) > $instance->grade) {
$errors['grade'] = get_string('gradeabovemaximum', 'assign', $instance->grade);