Deal with deleted questions

Created on 15 November 2017, over 7 years ago
Updated 26 July 2024, 8 months ago

In a perfect world, questions that have been part of a Quiz attempt would never be deleted.

But, it's possible, since there are currently no restrictions to prevent that from happening. Usually this happens in testing, but could happen in production.

The issues we have to deal with here are:

1. Users who answered a question in their attempt will no longer have that question, and can't view feedback for it
2. Reporting is affected because a Quiz's score cannot be recalculated
3. Admins may be locked out of certain areas of the site because the system expects an attempt to have all questions.

Issues pop up frequently, this should solve them all:
#2912759: HTTP 500 and "Undefined property: MultichoiceResponse::$result_answer_id" after editing question β†’
#2884069: 500 ajax error path:/system/ajax β†’
#2402535: Disabling a quiz question type module leaves quizes with an existing question of that type unusable β†’

I believe the solution here is to prevent deletion of questions unless they are:

1. Not in any quiz, or quiz revision
2. Not in any attempt's layout

πŸ› Bug report
Status

Active

Version

7.0

Component

Code - Quiz core

Created by

πŸ‡ΊπŸ‡ΈUnited States djdevin Philadelphia

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