Details
-
Improvement
-
Status: Peer review in progress
-
Minor
-
Resolution: Unresolved
-
4.0
-
None
Description
We had a big performance issue in a quiz activity view page.
After some investigation, we found there was an issue in the grade calculation formula and the regrading process kept calculating each access.
In our case, the each calculation took more than 10 sec and many students accessed at once, so the site was overloaded.
When calculating regrade ("grade_regrade_final_grades" function) in the grades page and the gradeing has some errors, the system show the errors in the page and set 'needsupdate = 0' to avoid further error.
https://github.com/moodle/moodle/blob/206023c15f680b2b3b2aab4d36515337491e0edf/lib/gradelib.php#L393-L403
But in the quiz activity view page, the system doesn't set 'needsupdate = 0' and keep calculating regrade.
https://github.com/moodle/moodle/blob/206023c15f680b2b3b2aab4d36515337491e0edf/lib/gradelib.php#L448-L451
We can't see any errors in the quiz activity view page, so we don't know what's going on.
The calculation can't fix automatically, so it's better to show something error when the issue is happening.