How toeng2002/longtest-police works
This repository implements a Thai police-exam practice web application. The main workflow is for a user to sign in, choose an agency, level, and subject, take an exam, and review results and history. Admins manage exam questions and related settings, with CSV import as a separate management capability. The source excerpts show several browser modules making direct Supabase requests; they do not establish all page-loading or module-wiring relationships, so those are omitted.
Main entry points: app-auth.js Authentication · app-quiz.js Quiz and results · app-admin.js Question administration · app-settings.js Admin settings
Components 12
Access and identity
- Authentication
js/app-auth.js - Profile and preferences
js/app-profile-settings.js
Exam experience
- Quiz and results
js/app-quiz.js - Exam protections
js/anti-cheat.js
Exam administration
- Question administration
js/app-admin.js - Admin settings
js/app-settings.js - CSV import
js/app-csv.js
Runtime support
- Exam data access
js/exam-db.js - Offline cache
sw.js
Other components
- Exam taker
- Administrator
- Supabase
Connections 10
- Exam taker → Authentication: signs in
js/app-auth.js - Authentication → Supabase: reads and writes
js/app-auth.js - Exam taker → Quiz and results: takes exam
js/app-quiz.js - Quiz and results → Supabase: loads and saves
js/app-quiz.js - Administrator → Question administration: manages questions
js/app-admin.js - Question administration → Supabase: manages questions
js/app-admin.js - Administrator → Admin settings: manages settings
js/app-settings.js - Admin settings → Supabase: updates settings
js/app-settings.js - Administrator → CSV import: imports questions
js/app-csv.js - CSV import → Supabase: reads and imports
js/app-csv.js