# Five-step certificate eligibility

Passing all five active training steps is sufficient for certificate and transcript eligibility. Students must still belong to the program and have Active or Completed status. Admin approval remains required before official documents are released. Online exams continue to operate separately and do not block five-step certificates.

The earlier mismatch came from the step grades page checking only five steps while approval and document viewing additionally required online exam attempts. The shared eligibility check now uses the confirmed five-step rule for generation, approval and viewing. The transcript list and dashboard no longer impose an additional online exam requirement. Previous transaction fixes are included.

## Deploy

Back up the matching server files. Extract `five-step-eligibility-update.zip` into the application's root directory, preserving all folders. This package supersedes the previous certificate approval update and includes:

- `core/CompletionEligibility.php`
- `core/CertificateApproval.php`
- `public/modules/pending_certificates.php`
- `public/modules/step_grades.php`
- `public/modules/step_certificate.php`
- `public/modules/transcripts.php`
- `public/modules/view_certificate.php`
- `public/dashboard.php`

No database migration is required for this eligibility change. No student grades or approval decisions are altered by uploading these files. Do not import the full database.

After uploading, refresh Pending Certificates and approve the existing pending request. There is no need to regenerate it. Students with all five passed steps qualify even if they have no online exam attempts, failed an online exam, or their program has no active online exam. Incomplete steps and incorrect program assignments still block approval with an explanation.

## Verification

`php tests/certificate_approval_test.php` passes 23 checks using connection-local MySQL temporary tables. Checks include the five-step rule with absent or failed online exams, incomplete steps, incorrect program assignment, single/bulk approval, transcript updates and transaction rollback. All changed PHP files pass syntax checks. The pending local request also evaluates as eligible with the new rule; it was not automatically approved.
