Skip to content

fix(viewer): re-transform quiz questions on restart and default isAssessment to true - #709

Merged
vpPavithra merged 2 commits into
Sphere:masterfrom
vpPavithra:fix/quiz-restart-assessment
Aug 6, 2026
Merged

fix(viewer): re-transform quiz questions on restart and default isAssessment to true#709
vpPavithra merged 2 commits into
Sphere:masterfrom
vpPavithra:fix/quiz-restart-assessment

Conversation

@vpPavithra

Copy link
Copy Markdown
Contributor

Summary

  • On "Yes, Restart", the quiz overview flow now re-fetches and re-transforms the quiz artifact JSON (transformQuiz) before reopening the assessment/quiz dialog, so restarted attempts use freshly derived questions/question types instead of stale in-memory ones.
  • assessment-detail.component.ts: default quizJSON.isAssessment to true when the content doesn't explicitly specify it (was defaulting to false).

Tests

  • Added quiz.component.spec.ts covering transformQuiz (URL derivation, questionType defaulting, error handling) and the restart flow in openOverviewDialog.
  • Added assessment-detail.component.spec.ts covering the isAssessment default behavior and ngOnInit.
  • Note: specs under project/ are currently excluded by testPathIgnorePatterns in jest.config.js (pre-existing, marked "TEMPORARY: library and project folders blocked — src only"), so these do not run under yarn test yet. Verified logic manually against a modified local jest config; left the config untouched per existing convention.

@vpPavithra
vpPavithra merged commit b43a69a into Sphere:master Aug 6, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants