Hi,
Testing Moodle 3.11.3+ on PHP 8.0.12 and MySQL 8.0.27, when changing some conclusion settings for a task in a course I got this error:
Exception: round(): Argument #1 ($num) must be of type int|float, string given
After searching for the error I found references (related to other systems) that it could be caused by an incompatibility between Moodle and PHP 8 regarding types (strict types).
So i changed the file gradelib.php, line 1599 - from:
return round($number, 5);
to: (type casting)
return round((int)$number, 5);
And the error ceased.
May it happen on other files? Is there some actual solution instead changing manually all files with type mismatch?
OBS: It happened after I was testing some combinations of requirements for task conclusion, including trying to keep "Require approval grade" set without keeping "Student must receive a grade to conclude the course" set. I'm not sure if one of these combinations triggered the error, but after it happened I was not able to set "Require approval grade" in this and any other questionnaires, always raising the error. (I was trying to minimize the number of labels in the course - these new indicators of completed tasks are too big invasive - I really prefer the small squares as before)
*Maybe some descriptions of mentioned Moodle options and elements in this text may be inaccurate because I'm freely translating from another language, I don't use Moodle in English to be able check the actual name of these elements.