flag-quiz
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v14View latest version
Create a challenge, share the link, compete with friends on country flag identification.
Live: https://kamalnrf-flag-quiz.val.run
- Create a challenge — pick your name and number of flags
- Share the
/c/{id}link with friends - Everyone gets the same flags (seeded shuffle), so it's a fair fight
- Per-challenge leaderboard shows who's on top
POST /challenge → { name, rounds } → { id }
GET /c/{id} → challenge page (HTML)
GET /c/{id}/leaderboard → scores for that challenge
POST /c/{id}/score → submit { name, score, total, speed_bonus, streak_best }
GET /quiz?n=5 → standalone random quiz (no challenge)
- 1 point per correct answer
- Up to 2 speed bonus points (faster = more)
- +1 streak bonus at 3+ consecutive correct
- 12-second timer per question