-
Bug
-
Resolution: Fixed
-
Major
-
2.3.10, 2.4.7, 2.5.3, 2.6, 3.3.4, 3.4.2
-
MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE
-
MOODLE_35_STABLE, MOODLE_36_STABLE
-
MDL-43428-master -
The quiz timer displays incorrect time remaining for quizzes where the time limit is greater than the time left before the quiz closes and where there is more than an hour left before closing.
For example:
Quiz close time: 5:00 pm
Quiz time limit: 3 hoursIn this example, if the student starts an exam any time between 2:01 pm and 3:59 pm, they will receive a timer that extends passed the closing time of the exam. If they trust the timer and submit any time after 5:00 pm ( +grace period ), the exam will not submit.
The following cases are true:
If the student opens/reloads the exam at 1:30 pm the timer will show 3 hours, this is correct.
If the student opens/reloads the exam at 3:00 pm the timer will show 3 hours, this is not correct (2 hours remain).
If the student opens/reloads the exam at 4:15 pm the timer will show 45 minutes, this is correct.
The problem exists within the openclosedate rule located in mod/quiz/accessrule/openclosedate/rule.php:106. The rule only returns a time_left_display if the time left is less than QUIZ_SHOW_TIME_BEFORE_DEADLINE which is defined as 3600 (1 hour) at mod/quiz/locallib.php:49
Since the openclosedate rule only returns a time if the quiz is within an hour before closing, the evaluation of the lowest time remaining (done at mod/quiz/accessmanager.php:442) results in the timer value.