# RIASEC Personality Test

Initial implementation for a XAMPP-hosted PHP application.

## Current scope

- Participant start form with full name, email, phone number, and language selection
- One-question-at-a-time assessment flow
- Question import from the source workbook in `resources/riasex test (new).xlsx`
- Automatic RIASEC scoring for the six interest areas
- On-screen report with score lines, descriptions, career opportunities, and suitable programme placeholders
- Browser print support and direct PDF download for participant and administrator report output
- Administrator login and participant report console
- MySQL-backed persistence for sessions, answers, admin users, and reports when the local database is available
- SENTRAL College Penang branding and green theme
- Admin-managed English source content for interest area descriptions, questions, careers, and programmes
- Runtime translation of participant-facing content into English, Bahasa Melayu, Chinese, and Tamil with local cache fallback

## Default administrator login

- Email: `admin@riasec.local`
- Password: `Admin123!`

## Local run

1. Point Apache to the `public` folder or browse to `/RIASEC/public` in XAMPP.
2. Create the `riasec` database and import `database/schema.sql`, or allow the app to fall back to JSON files until MySQL is ready.
3. Ensure the `storage/reports`, `storage/pdfs`, and `storage/translation-cache` directories are writable.
4. Open the participant start page and complete the test.
5. Open `/RIASEC/public/admin/login` to review stored reports.

## Notes

- When MySQL is reachable, the app stores test sessions, participant answers, admin users, and reports in the `riasec` database. JSON report files remain as a fallback snapshot layer in `storage/reports`.
- Generated PDF files are saved in `storage/pdfs` and can be re-downloaded by administrators at any time.
- Administrators now maintain English source content only. Participant questions, area descriptions, careers, and programmes are translated at runtime for the selected language.
- The runtime translator uses `https://translate.googleapis.com/translate_a/single` by default and caches responses in `storage/translation-cache`. You can override it with `RIASEC_TRANSLATION_ENDPOINT`, `RIASEC_TRANSLATION_TIMEOUT`, and `RIASEC_TRANSLATION_ENABLED`.