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:
Tim Hunt
2012-07-02 16:44:35 +08:00
committed by Dan Poltawski
parent 592443f4e1
commit 2b1b2017a6
+4 -4
View File
@@ -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)
)
)