-
Bug
-
Resolution: Duplicate
-
Major
-
None
-
3.9.14, 3.10.11, 3.11.7, 4.0.1
-
None
-
MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
Hello,
We found an issue in Moodle Quiz : Under certain circumstances, the client browser may think that the time has expired while the server has not.
This happens for example when the client PC updates the time in the middle of a quiz.
It is also possible that teacher added some time in a pending quiz.
This bug occurred for us in our exam room, where the PCs are not permanently on, and during an examination which took place shortly after the summer time change (+1h), a small part of the machines did not reset the time as soon as they started up, but only after a few minutes... right in the middle of the test.
This had the effect of finalizing the attempt of some students, rightly frustrated.
We are not the only one having this same issue, which occured already in 3.9 apparently (https://moodle.org/mod/forum/discuss.php?d=433280 )
How to reproduce:
- Set a test with a time limit
- Start the test
- Change the time of the client (add an hour)
- The test is automatically finished, regardless of the time remaining on the server side.
How to fix:
I propose you to fix this bug with a little change in the mod/quiz/attemptlib.php file
In the function process_attempt(...), search for these lines :
if ($timeup){ |
if ($this->get_quiz()->overduehandling === 'graceperiod') { |
[...]
|
} else { |
$finishattempt = true; |
}
|
}
|
And add a test for the server time in the else{} part like this :
if ($timeup) { |
if ($this->get_quiz()->overduehandling === 'graceperiod') { |
[...]
|
} else { |
// Under certain circumstances, the client browser may think that the time has expired while the server has not. |
// This happens for example when the client PC updates the time in the middle of a quiz. |
if ($timenow >= ($timeclose - QUIZ_MIN_TIME_TO_CONTINUE)) { |
// Time is really up. Finish attempt. |
$finishattempt = true; |
} else { |
// Nothing to do: the attempt can continue because there is still time. |
debugging('The client browser wrongly thought time was up for a quiz attempt.', DEBUG_DEVELOPER); |
}
|
}
|
}
|
(below I join the full correction in attemptlib.php (moodle 4.0.1+) and patchs for current MOODLE_400_STABLE and MOODLE_311_STABLE branches )
- duplicates
-
MDL-67512 Quizz - with time limit and auto-submission, problems if date/time changed on user computer
-
- Closed
-