Quiz take page does not finalize quiz when countdown time limit reached

Created on 13 March 2017, about 8 years ago
Updated 2 November 2024, 5 months ago

When quiz time limits are enabled with the jquery countdown module and the time limit has expired, the finished (JS) function triggered by the countdown timer finish event attempts to either submit the current quiz take form or reload the page if a single "Next"/"Finish" submit button can't be found. For some reason the quiz take form contains two "Next" submit buttons, one of them hidden (see line around 215 in quiz_question.module: $form['navigation']['submit_hidden'] = array(), thus the JS finished function reloads the page - I'm guessing because this should cause the quiz attempt to be finalised if the time limit is up. However the code to generate the quiz take page/form does not check the time limit (it looks like this is only done when the form is submitted). I'll attach a patch that finalizes the quiz if the time limit is expired upon loading the quiz take page.

Of course either the hidden submit button should be removed or the JS updated to correctly handle the presence of the hidden submit button when looking for buttons to submit the form, but I don't know which is the preferred approach (what is the hidden submit button for?).

πŸ› Bug report
Status

Postponed: needs info

Version

5.0

Component

Code - Quiz core

Created by

πŸ‡¦πŸ‡ΊAustralia OliverColeman

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024