What: Ensure that deleting a course module also cleans up associated quizzes and submissions.
Why: When an admin removes a module from a course, orphaned quiz records and submissions remain in the database, causing data inconsistency.
Scope: In the module deletion logic, delete all quizzes for the module and their submissions. Use database transaction to ensure atomicity. Log the cleanup action.
Acceptance criteria:
- Deleting a module removes associated quizzes
- Submissions for deleted quizzes are removed
- Operation is atomic (all or nothing)
- Cleanup is logged in audit logs
Technical context: src/database/schema.ts:88-109 — quizzes table. src/database/schema.ts:113-142 — quizSubmissions.
What: Ensure that deleting a course module also cleans up associated quizzes and submissions.
Why: When an admin removes a module from a course, orphaned quiz records and submissions remain in the database, causing data inconsistency.
Scope: In the module deletion logic, delete all quizzes for the module and their submissions. Use database transaction to ensure atomicity. Log the cleanup action.
Acceptance criteria:
Technical context:
src/database/schema.ts:88-109— quizzes table.src/database/schema.ts:113-142— quizSubmissions.