-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
4.5.2
-
MOODLE_405_STABLE
While reviewing MDL-84327 (specifically this comment) I spotted some issues with the code implemented in MDL-79718:
- The if (!empty($overrides)) { is not necessary, so it would be better to remove it.
- Has anyone thought about performance here? What is the memory implications of using get_all_overrides? I guess this is in a task so we can live with it, but I am wondering why quiz_get_attempt_usertime_sql was not used when this was originally implemented? (See, for comparison, mod/quiz/classes/task/update_overdue_attempts.php)
- Is update_user_with_date_overrides correct in all cases? e.g. about the case where the quiz has a timeopen, but then one particular user has timeopen overridden to 0 so they can start at any time? I think the code here gets it wrong (but quiz_get_attempt_usertime_sql gets it right)
- Also, from the
MDL-84327code: it is loading all enrolled users in the course and then filtering the list in memory. This is less efficient than using get_user_list_sql and not loading the unwanted users at all.