turnitin / moodle-mod_turnitintooltwo

Turnitin Direct plugin (version 2) for Moodle
http://www.turnitin.com
31 stars 65 forks source link

Display grade as percentage + not yet graded + PHP 8+ Causes an error. #662

Open jjs105 opened 1 year ago

jjs105 commented 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).'%';

matithyah commented 1 year ago

Thanks for noting this - just came across it after moving our Moodle instance to PHP8.