feat(quizzes): module quiz history, archive endpoint, and quiz analytics - #505
Merged
DeFiVC merged 2 commits intoSep 30, 2026
Conversation
Adds three admin/course-creator endpoints: - GET /courses/:id/modules/:moduleId/quiz-history: aggregate stats across every quiz in a module (average score, pass rate, total attempts, score distribution), scoped to the module rather than the whole course. - POST /admin/courses/:id/modules/:moduleId/quizzes/:quizId/archive: a dedicated route delegating to the existing ChainLearnOfficial#413 update-quiz path with { archived: true/false }, for discoverability. - GET /admin/courses/:id/modules/:moduleId/quizzes/:quizId/analytics: per-question correct rate and common wrong answer, score distribution, and current-vs-superseded attempt counts. Per-question timing is not tracked anywhere in the submission data, so it's reported as explicitly unavailable rather than fabricated. Both aggregate endpoints are cached 5 minutes and invalidated on every quiz write path. ChainLearnOfficial#468 (duplicate imports in course.service.ts) was already fixed on main; no changes needed for it.
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.
Summary
POST /api/v1/admin/courses/:id/modules/:moduleId/quizzes/:quizIdendpoint #413 update-quiz path with { archived: true/false }, same atomic transaction and audit log, added purely for discoverability over the generic update endpoint.Both aggregate endpoints are cached 5 minutes via the existing cacheGetOrSet helper and invalidated on every quiz write path.
Issue #468 (duplicate imports in course.service.ts) was already fixed on main before this branch was created; verified and made no changes for it.
closes #415
closes #416
closes #417
closes #468
Test plan