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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user