07 — Component Library (Results Module)
- R-DataTable (virtualised results grid)
- R-GradeChip
- R-MarksField
- R-CoverageBar
- R-GradeDistributionChart
- R-PublishPanel
Module-specific components. Shared components (
AppTextField,AppSelect,AppSnackbar,AppOfflineBanner,AppEmptyState,AppErrorState,AppSkeleton,AppBanner,StatusChip,ProgressIndicator,FilterChip) are referenced from 03_Component_Library.md — not reproduced here.
R-DataTable (virtualised results grid)
- Purpose: marks-entry grid for S1; report-card subject table for S4.
- Props:
columns,rows,editableCell,onCellChanged,rowStates(dirty/saving/saved/error/published),maxMarks. - Behaviour: virtualised (only visible rows built — see 15_Flutter §Table); per-row editing; numeric keyboard; tabular numerals (02_Design_Tokens.md §2).
- States: loading (skeleton), clean, dirty, row-save spinner, row-error (
errorContainerfill +errorText), published-locked. - A11y: header
Semantics; row label "Student {name}, marks {v} of {max}". - Tokens:
surfaceContainerHighheader,outlineVariantgridlines,mononumerals.
R-GradeChip
- Purpose: grade badge (A+/A/B+/B/C/D/F or client-supplied string).
- Props:
grade,size. - Behaviour: colour by band (
result.service.ts:130-138): A+/Asuccess, B+/Bprimary, C/Dtertiary, Ferror; unknown string →surfaceVariant+ neutral text. - A11y: announced as letters, never symbols ("grade A plus").
- Tokens: role-colour container +
on*Containertext,labelMedium.
R-MarksField
- Purpose: numeric marks input bound to a student row.
- Props:
studentId,value,maximumMarks,passingMarks,readOnly,onCommit. - Behaviour: local text state until commit; validation client-side
value ≤ maximumMarksmirrors server rule (examination.service.ts:145-146); over-max shows inline error without a round trip. - Tokens:
AppTextFieldtokens; errorerror/errorContainer.
R-CoverageBar
- Purpose: marks-entry completeness (S2, S5).
- Props:
entered,total. - Behaviour: 100 % →
success; partial →primary; 0 →surfaceVariant; label "n of m". - A11y:
Semantics(value: "entered n of m").
R-GradeDistributionChart
- Purpose: S5 per-grade bars.
- Props:
counts: Record<grade, number>,total. - Behaviour: horizontal bars per band incl. ungraded bucket; pure Flutter
Row/FractionallySizedBox— no chart dependency (see 15_Flutter §Charts). - A11y: each bar =
Semantics(label: "Grade {g}, {n} students ({p}%)"); counts always rendered as text. - Tokens: band colours per
R-GradeChip.
R-PublishPanel
- Purpose: S5 publish action with confirmation.
- Props:
examId,status,coverage,onPublish. - Behaviour: disabled unless coverage 100 % (advisory — server accepts regardless,
examination.service.ts:203-220); confirm dialog warns "cannot be reverted — no unpublish endpoint"; on success bannersuccess"Results published", firesPOST /api/v1/examinations/:id/publish(examination.controller.ts:54-56). - Tokens:
successcontainer /primaryFAB.