# Result section mapping update — 2026-10-02

This update makes the database relationship `classes.section_id -> sections.id` authoritative for result configuration selection.

Mapping:
- `sections.stage/name` containing Nursery or Primary -> `primary` result profile
- Play Class -> `play` result profile
- Secondary -> `secondary` result profile

Changes:
- `api/classes.php` now returns `section_id`, `school_section_name`, and `school_section_stage` when full class rows are requested.
- `api/student.php` now returns the same class-section metadata with student records.
- `api/shared/ResultConfiguration.php` resolves result profiles from the joined `sections` row before any legacy text fallback.
- `api/results.php` and `api/teachers_results_and_comments_update.php` use the same section-based resolver for validation/calculation/play-class behavior.
- If a school has only one recognisable section profile, that profile is used as a safe fallback rather than assuming Secondary.

No database migration is required for this update. Existing `section_id` assignments and the current `sections` table are used.
