-
Bug
-
Resolution: Fixed
-
Minor
-
2.8.7, 2.9, 3.0
-
MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE
-
MOODLE_28_STABLE, MOODLE_29_STABLE
-
MDL-50894_master -
When you run a cron a
$ php admin/cli/cron.php
The below warning is displayed.
PHP Warning: Division by zero in lib/conditionlib.php on line 1221
This error comes from the below division in get_cached_grade_score when it runs across grades with zero rawgrademax value. There are grade items with grademax set to zero. This code should handle such grade items without throwing errors.
foreach ($rs as $record) {
|
$cachedgrades[$record->id] =
|
is_null($record->finalgrade)
|
// No grade = false
|
? false
|
// Otherwise convert grade to percentage
|
: (($record->finalgrade - $record->rawgrademin) * 100) /
|
($record->rawgrademax - $record->rawgrademin);
|
- has been marked as being related by
-
MDL-51002 Grade condition is not computing the grades properly
-
- Closed
-