MDL-34109 quiz cron: timelimit are timeclose of 0 are special.
If the timelimit or timeclose of a quiz are 0, this means 'no restriction', rather than '1970' or '0 seconds'. We need to handle these special cases correctly in the code that looks for quiz attempts that might be in the wrong state.
This commit is contained in:
@@ -127,15 +127,15 @@ class mod_quiz_overdue_attempt_updater {
|
||||
|
||||
WHERE (
|
||||
state = 'inprogress' AND (
|
||||
:timenow1 > usertimeclose OR
|
||||
:timenow2 > quiza.timestart + usertimelimit
|
||||
(usertimeclose > 0 AND :timenow1 > usertimeclose) OR
|
||||
(usertimelimit > 0 AND :timenow2 > quiza.timestart + usertimelimit)
|
||||
)
|
||||
)
|
||||
OR
|
||||
(
|
||||
state = 'overdue' AND (
|
||||
:timenow3 > graceperiod + usertimeclose OR
|
||||
:timenow4 > graceperiod + quiza.timestart + usertimelimit
|
||||
(usertimeclose > 0 AND :timenow3 > graceperiod + usertimeclose) OR
|
||||
(usertimelimit > 0 AND :timenow4 > graceperiod + quiza.timestart + usertimelimit)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user