-
Bug
-
Resolution: Won't Do
-
Minor
-
None
-
2.3.9, BACKEND
-
None
-
MOODLE_23_STABLE
When grade letters get calculated in file lib/gradelib.php, divisions and multiplications are made on the given (float) grades (function grade_format_gradevalue_letter($value, $grade_item)). Thereby floating point errors can occur, for instance, if $value=58 is given, after those operations 57.99999999999999289457264239899814128875732421875000.
Then, the comparison between 57.999999999 >= 58 does not work anymore. Therefore, the student gets a worse grade (letter) as he deserves.
The fix could be a simple
$value = round($value, 10);
before the comparison loop starts...
- will be (partly) resolved by
-
MDL-21746 Gradebook incorrectly rounds grades, including calculation of completion
-
- Reopened
-