-
Bug
-
Resolution: Fixed
-
Minor
-
4.0.6, 4.1.1
-
MOODLE_400_STABLE, MOODLE_401_STABLE
-
MOODLE_400_STABLE, MOODLE_401_STABLE
-
MDL-77094_401 -
At the moment, quiz_statistics\task\recalculate is loading all information about every quiz, before deciding whether it needs to do any work on that quiz. this is unnecessary. On our system, the task is rarely managing to check all quizzes within it's one hour time-limit.
So, the changes I have made are:
- When getting the list of quizzes to consider, order this so that attempts with the most recetly finished attempts are processed first. These are most likely to be the interesting ones.
- Also, ensure this query returns all the data we need to determine if there is any work to do for this quiz in only one more DB query. (That one query is unavoidable until
MDL-75197is done.) - Related to this, I made the task output slighly less verbose.
- And, this meant that I was able to move more of the code for doing the real work into the try-catch, which is probably good.
The task output now looks like:
'Quiz 1' (440000) in course tc_1 (139000) has most recent attempt finished at 1/02/23, 00:51:51 so re-calculating statistics for 4 attempts, start time 1/02/23, 00:51:51 ...
|
Calculations completed at 1/02/23, 00:51:51.
|
'Quiz 2' (440001) in course tc_1 (139000) has most recent attempt finished at 1/02/23, 00:51:51 so re-calculating statistics for 4 attempts, start time 1/02/23, 00:51:51 ...
|
Calculations completed at 1/02/23, 00:51:52.
|
'Quiz 3' (440002) in course tc_1 (139000) has most recent attempt finished at 1/02/23, 00:51:51 and statistics from 1/02/23, 00:51:52 so nothing to do.
|
- has a non-specific relationship to
-
MDL-75576 Question bank statistics are fetched in a terribly inefficient way
- Closed
-
MDL-76649 Quiz statistics scheduled task gives no useful info about failures, making it impossible to investigate bugs
- Closed
- has been marked as being related by
-
MDL-75197 quiz_statistics table could usefully have a quizid column added
- Closed