SMI Retake Code Required Patch - 2026-08-03
============================================

- Changed reset attempts from in_progress to cancelled after clearing.
- Prevented direct resume immediately after teacher/admin reset.
- Required a fresh code entry before a new retake attempt is created.
- Added private-code enforcement even when the global exam code requirement is disabled.
- Generates a private retake code when an exam has no existing code.
- Uses MAX(attempt_number)+1 to preserve cancelled-attempt history without duplicate keys.
- Keeps the private retake window for a globally closed exam.
- Replaces only student/exams.php, teacher/exams.php, and admin/exams.php.
