Examination, Assessment & Report Cards
The academic evaluation pipeline: ExamSchedule → StudentMark → ReportCard. Covers exam scheduling, marks entry with automatic grading, weighted report card generation (including a live-rendered PDF and a pull of Chapter 10 attendance data), exam analytics, and a promotion / re-evaluation workflow that is fully built on the backend today.
Exam Data Flow
Basic Tier Features
BasicExam Scheduling
- ExamSchedule model: title, course, examType (unit_test/mid_term/final/practical/oral/project), term, academicYear, scheduledDate
- maxMarks defaults to 100, passMarks defaults to 35, weightage defaults to 100 — all overridable per exam
- Configurable gradeThresholds (A+/A/B/C/D boundaries) drive automatic grade computation
- Editing or deleting a schedule is blocked once any marks have been entered against it
- isPublished gate controls student/parent visibility of the schedule
- Admin UI: /dashboard/admin/grades/exams, /dashboard/admin/grades/exams/create
Marks Entry
- StudentMark model, unique per (examSchedule, student) — upserted, never duplicated
- Bulk entry endpoint accepts an array of { studentId, marksObtained, isAbsent, remarks } in one request
- Absent students get marksObtained: null, grade: "AB", isPassing: false
- Grade computed against the parent exam's gradeThresholds at entry time and on every update
- Teacher UI: /dashboard/teacher/grades, /dashboard/teacher/grades/[examId] — marks entry grid
Report Card Generation
- Aggregates every StudentMark for a term/academicYear per student, grouped by subject (course)
- Applies each exam's weightage to compute per-subject percentage, final grade, and pass/fail
- Pulls the student's attendance percentage for the term's date range from Chapter 10's DailyAttendance data
- Class is dense-ranked by overallPercentage within the same generation batch (rank + classSize stored on each card)
- Admin can add principalRemarks and per-subject teacherRemarks before publishing
- Legacy term cards are generated through the queue (POST /api/grades/report-cards/generate). Current grade cards use the CCE flow below, and their PDF is rendered from the current marks on each download (services/reportCardBooklet)
- Admin UI: /dashboard/admin/grades/report-cards · Student UI: /dashboard/student/grades/report-card/[id]
Exam & Report Card Analytics
- Subject-wise, class-wise, and school-wide performance analytics
- Individual student performance trend across exams
- Class/section/school ranking tables
- Admin UI: /dashboard/admin/grades/analytics — 4-panel dashboard (subject, class, school, ranking)
Promotion Management
- Evaluates every student against their published annual report card: any failed subject, or attendance % below a configurable minimum (default 75%), flags them
- Admin records a promote or detain decision per student; promotion delegates to the Chapter 6 Student Lifecycle promotion recorder (class/section/academic-year change)
- Every decision is written to AuditLog and surfaced via a promotion report endpoint
- Student/parent read-only endpoint for own promotion history
- API-only today — no dedicated web/mobile promotion UI has been built yet
Re-evaluation Requests
- Student or linked parent requests re-evaluation of a specific StudentMark with a reason; one request per mark (unique constraint)
- Admin reviews and approves or rejects
- Once approved, a different teacher re-enters the mark via the normal marks-update endpoint, then the request is marked completed with before/after marks recorded
- Every completion is audit-logged
- API-only today — no dedicated web/mobile re-evaluation UI has been built yet
Result Publication
- Exam schedules and report cards each carry their own isPublished / publishedAt gate
- Students only ever see published exam schedules and their own published report cards
- Parents see a published report card only for a linked child
- Parent UI: /dashboard/parent/exams
CCE Grade Cards (FA-1 … SA-2) — New
- Grade cards follow the printed CCE booklet: FA-1, FA-2, SA-1, FA-3, FA-4, SA-2 (utils/cceGrading). One ReportCard per student, exam, academic year and class, so a promotion starts a fresh set and old cards stay as history
- Formative (FA) subject total is out of 50: participation 10 + written work 10 + project work 10 + slip test 20
- Summative (SA) marks are out of 50 plus the average of the FA totals that feed it (SA-1 uses FA-1 and FA-2, SA-2 uses FA-1 to FA-4), giving a subject total out of 100. Saving an FA recomputes the F.A. column of that year's SA cards
- Grade scale: A1 ≥91, A2 ≥81, B1 ≥71, B2 ≥61, C1 ≥51, C2 ≥41, D ≥35, E below 35. Pass mark 35%
- Subjects on a card are exactly the subjects created for the student's class (utils/classSubjects), with no fixed list
- Also stored: four co-curricular marks out of 50, attendance by month (months left blank are filled from daily attendance), the year-end result (passed, promoted, detained) and principal remarks
- Admin only: teachers cannot open or edit a card. Parents and students see a card only after the admin publishes it
- Publishing notifies the child's parents (REPORT_CARD_PUBLISHED) and schedules the PDF pre-build. PDFs render from the current marks on every download in the CCE booklet layout (services/reportCardBooklet), nothing is stored, so a card never goes stale
- Excel export of a class and exam: GET /api/grades/report-cards/export/excel
Teacher Marks Submission & Admin Approval — New
- The teachers of a subject enter its marks for the class and send them to the admin; the admin approves and the marks land on every student's card
- GradeCardSubmission model: student, class, section, academicYear, term, course, teacher, kind (formative or summative), components or saMarks, remarks, status (draft, pending, approved, rejected), reviewedBy, rejectionReason. Unique per (student, term, academicYear, course)
- One sheet is shared by every teacher of the subject (the main teacher and the co-teachers, Chapter 11); each row records its last editor. Nobody else may fill it. Admins view and review but cannot save one. Entries are capped to each field's maximum and every student must belong to the subject's class and section (max 500 per request)
- Each student has their own state: no row, draft, pending, approved or rejected. Pending and approved rows are locked for every teacher; all the others stay editable. So one teacher sending some students for approval never blocks another teacher working on different students
- Approve writes each pending row onto the student's ReportCard with the same CCE maths as the admin editor, replaces that subject's row if it exists, recomputes the overall percentage and grade, and refreshes SA averages. If the card was already published it is updated in place and the response says how many
- Reject requires a reason. Notifications: grade_card_submitted to admins, grade_card_approved and grade_card_rejected to every teacher of the subject
- Clashes are detected, not overwritten: every row is sent back with the version (updatedAt) the teacher loaded, and a save is applied only if nobody changed or sent that row since (compare-and-set). Otherwise the student comes back in conflicts[] with the other teacher's name and the screen reloads. A student already with the admin comes back in locked[]. Sending only sends the teacher's own students (changed or drafted by them), so another teacher's draft is not sent by accident. Publishing a card to parents stays an admin action. Removing a teacher from a subject (Chapter 11) hands unfinished rows they last edited to the main teacher
- Exam-schedule marks follow the same rule: a teacher may open, enter or edit marks only for exams of subjects they teach (403 otherwise)
Planned — Not Yet Implemented
Not Yet Implemented
- Excel/CSV bulk import of marks — current bulk endpoint accepts a JSON array from the marks-entry grid, not a spreadsheet upload
- WhatsApp and email notifications on result publication — publishing a grade card today notifies parents in the app only
- GPA scale computation (4/5/10-point) — grade computation currently only supports letter grades (A+ through F) via configurable percentage thresholds
- Merit lists / top-performer certificates generation
- Dedicated admin/teacher UI for reviewing promotion decisions and re-evaluation requests (both workflows are API-complete but UI-less)
API Reference — Chapter 12
Exam Schedules & Marks
/api/grades/examsCreate an exam schedule (admin)
/api/grades/examsList exam schedules — teachers see only their own courses' exams
/api/grades/exams/:idGet a single exam schedule
/api/grades/exams/:idUpdate a schedule — blocked once marks exist
/api/grades/exams/:idDelete a schedule — blocked once marks exist
/api/grades/exams/:id/publishPublish the exam schedule to students
/api/grades/exams/:id/marksBulk enter/update marks for an exam
/api/grades/exams/:id/marksList all marks for an exam
/api/grades/exams/:id/marks/:sidUpdate a single student's mark
Student & Parent Marks View
/api/grades/my-marksStudent's own marks — published exams only
/api/grades/student/:studentId/marksParent/admin view of a student's marks
Report Cards
/api/grades/report-cards/generateGenerate/refresh report cards for a term + academicYear
/api/grades/report-cardsList report cards (admin)
/api/grades/report-cards/myStudent's own published report cards
/api/grades/report-cards/student/:sidParent/admin view of a student's report cards
/api/grades/report-cards/:idGet a single report card
/api/grades/report-cards/:id/remarksAdmin adds remarks (admin only)
/api/grades/report-cards/:id/publishPublish a report card
/api/grades/report-cards/:id/downloadStream the report card as a PDF (pdfkit)
Analytics
/api/analytics/exam/subjectSubject-wise performance analytics
/api/analytics/exam/classClass-level analytics (avg, pass rate, distribution)
/api/analytics/exam/schoolSchool-wide result analytics
/api/analytics/exam/student/:idIndividual student performance trend
/api/analytics/exam/rankingClass, section, school ranking tables
Promotion
/api/promotions/evaluateEvaluate promotion eligibility for a class/section/year
/api/promotions/approveRecord promote/detain decisions in bulk
/api/promotions/reportPromotion decision audit report
/api/promotions/my/:studentIdStudent/parent read-only promotion history
Re-evaluation
/api/re-evaluationStudent/parent requests re-evaluation of a mark
/api/re-evaluationAdmin review queue
/api/re-evaluation/myRequester's own re-evaluation requests
/api/re-evaluation/:id/reviewApprove or reject a request
/api/re-evaluation/:id/completeMark a request completed after the mark is re-entered
CCE Grade Cards (Admin)
/api/grades/report-cards/saveSave a card as draft or publish it (admin, super_admin)
/api/grades/report-cards/class-subjects/:studentIdSubjects created for the student class - the card lists exactly these
/api/grades/report-cards/attendance/:studentIdAttendance already recorded for the months of an exam
/api/grades/report-cards/booklet/:studentIdCCE booklet PDF for a student and academic year
/api/grades/report-cards/export/excelExcel export of the cards of a class and exam
Grade Card Marks - Teacher Submissions (New)
/api/grades/card-submissions/my-subjectsTeacher: the subjects they teach, plus the exam list
/api/grades/card-submissions/sheetTeacher or admin: one subject, exam and year with every student, status and any rejection reason
/api/grades/card-submissions/sheetTeacher: save a draft or submit the sheet for approval
/api/grades/card-submissionsAdmin: sheets by status (default pending), one row per subject and exam
/api/grades/card-submissions/approveAdmin: approve a sheet and write the marks onto the cards
/api/grades/card-submissions/rejectAdmin: send a sheet back with a required reason
Frontend Pages
| Path | Role | Description | Tier |
|---|---|---|---|
| /dashboard/admin/grades/exams | Admin | Exam schedule list | Basic |
| /dashboard/admin/grades/exams/create | Admin | Create an exam schedule | Basic |
| /dashboard/admin/grades/report-cards | Admin | Generate, review, and publish report cards | Basic |
| /dashboard/admin/grades/analytics | Admin | Subject / class / school analytics + ranking | Basic |
| /dashboard/teacher/grades | Teacher | Exams assigned to the teacher's courses | Basic |
| /dashboard/teacher/grades/[examId] | Teacher | Marks entry grid for an exam | Basic |
| /dashboard/student/grades | Student | Published marks across exams | Basic |
| /dashboard/student/grades/report-card/[id] | Student | Individual published report card view | Basic |
| /dashboard/parent/exams | Parent | Child's exam schedules and published results | Basic |
| /dashboard/admin/grade-cards | Admin | Enter, edit and publish grade cards | Basic |
| /dashboard/admin/grade-card-approvals | Admin | Review and approve or send back teachers marks (New) | Basic |
| /dashboard/teacher/grade-card-marks | Teacher | Enter marks for own subjects and send for approval (New) | Basic |
Mobile Screens
(student)/exams.tsx(student)/report-card.tsx(parent)/exams.tsx(parent)/report-card.tsx(parent)/reports.tsx(admin)/grade-cards.tsx(admin)/grade-card-approvals.tsx(teacher)/grade-card-marks.tsxNo teacher-facing mobile screen exists yet for marks entry — teachers enter marks via the web marks-entry grid only.
