Class Tests
A teacher picks a section, subject and chapter; the system AI-generates a question paper; the teacher reviews and edits the questions; assigns to all (or a subset of) students; students take the test; MCQs auto-grade; short/long answers grade by model answer match; the student sees their result and the parent app shows the score.
At a glance
| Who can do this | Teachers create / review / assign · Students take · Parents view (read-only) |
| Where it lives | Teacher app /dashboard/class-tests/* · Student app /dashboard/class-test/* · Parent app /class-tests |
| Triggers notifications? | Yes — push + in-app, on assign and on completion |
| Related features | Chapter Tests · Prep & Quick Tests · Notifications |
How it flows
Status lifecycle
The test has its own lifecycle (draft → generating → reviewed → published), while each student attempt has a parallel lifecycle (Assigned → InProgress → Submitted).
Step-by-step
1. Teacher kicks off creation
- App / route: Teacher app →
/dashboard/class-tests/create - Form fields:
- Test title (free text, e.g. "Mid-Chapter Summary Quiz")
- Section (any section in the school — teacher does not need to be assigned to it)
- Subject (only subjects mapped to that section show)
- Chapter (only chapters mapped to that subject show; with search)
- Pressing Generate with AI creates a
drafttest, then immediately fires an AI generation job (status flips togenerating). - The teacher is navigated to
/dashboard/class-tests/:id/review. - A test can also be pre-launched from a chapter test grouping — see Chapter Tests. In that case the section, subject, chapter and a target student set are pre-filled, and difficulty is adapted (Good → Hard, Average → Medium, Needs Improvement → Easy).
2. AI generates the question paper
- While
generating, the review page shows a loading state. - When the backend finishes, the test moves back to
draftwith populated questions (mix of MCQ / Short / Long, each with marks, optional hint, optional cognitive category like "Remember", "Apply", "Analyse").
3. Teacher reviews and edits
- App / route:
/dashboard/class-tests/:id/review - Per question the teacher can:
- Edit question text, options, correct answer, marks, type, cognitive category.
- Delete a question (max-marks recalculates).
- Header shows running max-marks total and total question count.
- Pressing Confirm flips status
draft→reviewedand routes to assign.
4. Teacher assigns to students
- App / route:
/dashboard/class-tests/:id/assign - Loads all students in the section. By default every student is selected.
- If the test was launched from chapter-test classification, the pre-selected set is just that classification (e.g. only "Needs Improvement" students).
- Teacher can search, toggle individual students or select-all.
- Pressing Publish flips status
reviewed→publishedand writes per-student attempt rows inAssignedstate. - Push + in-app notifications fire to selected students and their parents.
5. Student takes the test
- App / route: Student app →
/dashboard/class-test(list) →/dashboard/class-test/:testId(detail / instructions) →/dashboard/class-test/:testId/take/:attemptId(attempt). - Detail page shows: title, subject, chapter, difficulty, type, total questions, max marks, duration, teacher name, current attempt status.
- Starting an attempt flips status
Assigned→InProgressand starts the duration timer. - Per question UI:
- MCQ: tap an option.
- Short / Long: type into a textarea.
- Hint: a configurable number per test (default 3); using a hint marks that question as
isHintUsed.
- Timer counts down based on duration; on expiry a force-submit fires.
- On manual submit, status flips
InProgress→Submitted.
6. Auto-grading vs manual
- MCQ: graded immediately on submit by string-match against
correctAnswer. Score is finalized. - Short / Long: stored against the question; the result UI shows the student's answer next to the model answer side-by-side. (There is no separate teacher manual-grading page in the current build — the model answer comparison is the result.)
- Total score = sum of
obtainedMarksacross answers. Percentage = score / maxMarks.
7. Student sees the result
- App / route:
/dashboard/class-test/:testId/result/:attemptId - Shows score, percentage, per-question breakdown (correct / incorrect, model answer for non-MCQ).
- Result is published immediately on submit — there is no "results pending" gate.
8. Teacher sees class performance
- App / route:
/dashboard/class-tests/:id/submissions - Lists every student in the section with their attempt status (
Assigned/InProgress/Submitted), score, submission time. - Tapping a submission opens
/:id/submissions/:submissionIdfor the per-question breakdown. - Class-level radial-bar chart shows assigned-vs-completed counts and average marks.
9. Parent visibility
- App / route: Parent app →
/class-tests - One card per assigned class test for the linked child:
- Title, subject, chapter, difficulty
- Status badge:
Assigned/InProgress/Submitted/Completed/Overdue - Score + percentage progress bar (when completed)
- Read-only — no submission action.
Edge cases & things to test
- AI generation slow / failed: status stays
generatingfor too long — does the review page surface a retry path or does it just spin? - Teacher edits after publish: can a teacher still edit a question after
published? What does the student see if a question changes mid-attempt? - Subset re-publish: teacher publishes to 10 students, then later wants to add 5 more — does re-running assign top up or duplicate attempts?
- Timer expiry mid-attempt: student leaves the page, comes back later — timer should resume from
startedAt, not reset. Force-submit must fire if duration elapsed. - Hints exhausted: student uses all 3 hints — UI must disable the hint button on the next question.
- MCQ correct-answer encoding: backend stores correctAnswer either as the option text or as
A/B/C/Dletter — the UI normalises both. Test both shapes. - Empty short answer: student leaves a Short/Long question blank — it should grade as 0, not error.
- Section reassignment: student moved from Section A to Section B after publish — does the test stay visible in their list?
- Targeted publish from chapter test: launching from chapter-test classification preselects only those students; deselecting and reselecting must not lose the original target set.
- Notification fan-out: publish to 60 students in a section — all 60 students AND their parents must be notified within ~30s.
- Late starter: student opens the test 2 days after publish — can they still take it? Status flow should be
Assigned→InProgress→Submitted, no "overdue" gate. - Resubmit attempt: once a student submits, can they retake? Currently no — attempts are single-shot.
Related
- Chapter Tests — class tests can be launched directly from chapter-test student classifications
- Prep & Quick Tests — student-only test types (no teacher involvement)
- Notifications — assign and result transitions both fan out push + in-app
- Student Analytics — class test scores feed analytics