MDL-77094 quiz_statistics: improve efficiency of the recalculate task
commitc60878c90d46cca5ed231b45f1d83443d436cb73
authorTim Hunt <T.J.Hunt@open.ac.uk>
Tue, 31 Jan 2023 15:51:56 +0000 (31 15:51 +0000)
committerTim Hunt <T.J.Hunt@open.ac.uk>
Tue, 31 Jan 2023 15:58:48 +0000 (31 15:58 +0000)
tree5fd0bfc08fb579199e6b021940aefdc23e24a5ac
parent880462a1685f710ed4f6628d31c2fd7e67e0df73
MDL-77094 quiz_statistics: improve efficiency of the recalculate task

quiz_settings::create() requires at least 3 DB queries, so the point is
that we can avoid doing that until after we have worked out if we need
to calculate statistics for this quiz.

Also, we order the list of quizzes to consier, to process the ones with
more recent attempts first.
mod/quiz/report/statistics/classes/task/recalculate.php