# Phase 10 — Results, grading and GPA

Phase 10 implements the controlled academic-result lifecycle. It stops at results and
does not introduce finance, invoicing, payment, transcript, or certificate behavior.

## Delivered

- Institution-owned grading systems with score bands, pass/fail rules, grade points,
  rounding precision, and degree classifications.
- Validation that prevents inverted or overlapping grade bands.
- Result batches tied to one course offering and one grading system.
- Component score entry constrained by each course's continuous-assessment and
  examination weights.
- Append-only result snapshots for every initial entry and correction, including the
  actor, reason, source, and occurrence time.
- CSV import with row-level validation, file hash, accepted/rejected counts, and error
  evidence.
- CBT integration restricted to final marked, moderated, or released attempts linked
  to the same course offering and registered student.
- Sequential workflow: lecturer submission, Head of Department review, Examination
  Officer validation, Dean approval, board/Senate approval, and publication.
- Recorded decisions and comments at every workflow stage.
- Publication locks, privileged reopening with a mandatory reason, a new batch
  version, and a fresh approval trail.
- Publication-time course-completion updates and deterministic semester GPA and
  cumulative CGPA recalculation.
- Academic standing, earned/attempted units, failed-course count, degree
  classification, and preliminary graduation eligibility summaries.
- Administrative broadsheet screen and CSV export.
- Student self-service that queries published batches only.
- Tenant-aware authorization for entry, review, publication, export, and viewing.

## Calculation rules

The total is the sum of assignment, test, attendance, practical, and examination
components. Continuous-assessment components may not exceed the configured course CA
weight, and examination marks may not exceed the configured exam weight. The active
grading system maps the rounded total to a grade and grade point.

Quality points are `grade point × course credit units`. GPA and CGPA are the sum of
quality points divided by attempted credit units, rounded to two decimals. A passed
course contributes earned units; a failed course contributes attempted units and zero
earned units. The seeded academic-standing threshold is 1.50.

## Security and integrity

- Draft, reviewed, and approved-but-unpublished results never appear in student
  self-service.
- Published rows are locked and cannot be edited by the normal entry action.
- Reopening requires `results.publish` and records the reason as an append-only
  approval event.
- Cross-institution access is rejected by policies and tenant-qualified validation.
- Result imports keep evidence without exposing source files publicly.
- Published results alone update prerequisite completion records and GPA summaries.

## Demonstration data

The development seed supplies a five-point undergraduate grading system, six grade
bands, five degree classifications, and a draft batch containing ten versioned
student results. The batch remains draft so the approval workflow can be demonstrated.

## Verification

- Result workflow tests: 7 passed, 23 assertions.
- Full application suite: 85 passed, 309 assertions.
- Result migration rollback, reapplication, and reseeding completed successfully.
- Composer audit: no security vulnerability advisories.
- npm audit: zero vulnerabilities.
- Vite production bundle built successfully.

## Phase gate

Phase 10 is complete. Phase 11 (finance, invoices, payments, scholarships, and
reconciliation) requires explicit approval before implementation.
