Fix quiz answer reset bug. - #319
Merged
Merged
Conversation
|
|
✅ Deploy Preview for teaching-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
SilasBerger
commented
Sep 8, 2026
| - [ ] Für Prüfungen könnte es nützlich sein, das Konzept des Quiz zu erweitern, um nicht nur `ChoiceAnswer`-Fragen zu unterstützen, sondern auch andere Fragetypen wie z.B. `TextAnswer` oder `CodeAnswer`. So könnte eine Prüfung aus einem einzigen Quiz bestehen, in dem auch Fragen vorkommen, die nicht automatisch korrigiert werden können. Der Vorteil dabei wäre, dass so auch diese Fragen in die Randomisierung der Reihenfolge mit einbezogen werden könnten. Zudem könnte ein Report (PDF, druckbar) generiert werden, der die Ergebnisse aller automatisch korrigierten Fragen enthält, und für das Feedback zu den manuell zu korrigierenden Fragen einen Platzhalter lässt. No newline at end of file | ||
| - [ ] Für Prüfungen könnte es nützlich sein, das Konzept des Quiz zu erweitern, um nicht nur `ChoiceAnswer`-Fragen zu unterstützen, sondern auch andere Fragetypen wie z.B. `TextAnswer` oder `CodeAnswer`. So könnte eine Prüfung aus einem einzigen Quiz bestehen, in dem auch Fragen vorkommen, die nicht automatisch korrigiert werden können. Der Vorteil dabei wäre, dass so auch diese Fragen in die Randomisierung der Reihenfolge mit einbezogen werden könnten. Zudem könnte ein Report (PDF, druckbar) generiert werden, der die Ergebnisse aller automatisch korrigierten Fragen enthält, und für das Feedback zu den manuell zu korrigierenden Fragen einen Platzhalter lässt. | ||
|
|
||
| ## Testing Only |
Contributor
Author
There was a problem hiding this comment.
This section can be deleted before merging. It is just there to show that new quizzes (ones that the testers haven't yet created documents for) still work.
lebalz
approved these changes
Sep 8, 2026
lebalz
left a comment
Contributor
There was a problem hiding this comment.
LGTM, thanks for the investigation and the proposed fix 👍 Beside the suggested change: ready to merge
Co-authored-by: Balthasar Hofer <lebalz@outlook.com>
Contributor
Author
|
As dicussed offline: Merging this fix for now; further (more general) investigation advised. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a bug that lead to quiz answers getting lost.
Fix explanation
The likely cause lies in
iAssessable#_checkIntegrity(), where theiAssessableself-destructs if it can't find its own question ID in the parent quiz' question IDs. This helps us get rid of orphaned question documents, but only as long as we are looking at the actual quiz' question IDs. It seems like there can be a case where we are looking at maybe a dummy, which has an empty set of question IDs, which would lead to aniAssessableprematurely destroying itself, including aDELETErequest to the API.This fix uses the heuristic "a real quiz has at least one question ID" to prevent this cleanup mechanism from firing prematurely. My testing suggests that it does solve the problem, but further investigation into the logic of how and when we can rely on a document to be "the real deal" might be useful.
Original bug
Steps to reproduce:
What doesn't trigger the reset: