Open jjs105 opened 1 year ago
When configuring an activity to display grades as a percentage an error occurs (PHP 8+) due to trying to divide the sting '--' by 100.
mod/turnitintooltwo/turnitintooltwo_view.class.php, line 1298 original: $submissiongrade = round($submissiongrade / $parts[$partid]->maxmarks * 100, 1).'%'; fixed $submissiongrade = '--' == $submissiongrade ? '--' : round($submissiongrade / $parts[$partid]->maxmarks * 100, 1).'%';
$submissiongrade = round($submissiongrade / $parts[$partid]->maxmarks * 100, 1).'%';
$submissiongrade = '--' == $submissiongrade ? '--' : round($submissiongrade / $parts[$partid]->maxmarks * 100, 1).'%';
Thanks for noting this - just came across it after moving our Moodle instance to PHP8.
When configuring an activity to display grades as a percentage an error occurs (PHP 8+) due to trying to divide the sting '--' by 100.
mod/turnitintooltwo/turnitintooltwo_view.class.php, line 1298 original:
$submissiongrade = round($submissiongrade / $parts[$partid]->maxmarks * 100, 1).'%';
fixed$submissiongrade = '--' == $submissiongrade ? '--' : round($submissiongrade / $parts[$partid]->maxmarks * 100, 1).'%';