Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jjs105 opened this issue Oct 11, 2022 · 1 comment
Open

Comments

@jjs105
Copy link

jjs105 commented Oct 11, 2022

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants