Quiz not redirecting to quiz/QUIZ-ID

Created on 16 October 2019, almost 5 years ago
Updated 7 September 2024, 1 day ago

When the user is doing a quiz, if the session data necessary for navigation to the next question number is lost, the behaviour is erratic. The quiz should redirect back to quiz/QUID-ID path so the user can make a fresh start on the quiz. Currently a 403 'Access denied' occurs.

How to Fix it
Create an event listener. Listen to the 403 exception event. Add a condition so it applies if the current route is the quiz take route. Add a method to the QuizSessionInterface and implement it in QuizSession.php. It is a boolean that reports the current state of the quiz session data. It tests whether vital quiz session variables are missing.

Use the method as a second condition in the event listener.

πŸ“Œ Task
Status

Needs review

Version

7.0

Component

Code - Quiz core

Created by

πŸ‡¬πŸ‡§United Kingdom andrew.farquharson

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

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