The Timed Challenge Mode is a fast-paced training feature that tests your kana recognition speed and accuracy under pressure. It complements existing modes like Pick, Reverse-Pick, Input, and Reverse-Input with a time-bound twist.
- ⏱ 60-second challenge window
- 🎯 Real-time scoring with streak tracking
- 🧠 Instant feedback on each answer
- 📊 Separate stat tracking for timed mode (correct, incorrect, streak)
- 🔁 Retry option with full stat reset
| File | Purpose |
|---|---|
lib/generateKanaQuestion.ts |
Utility to randomly select kana from user’s selection |
store/useStatsStore.ts |
Extended Zustand store with timed stats |
components/Dojo/Kana/TimedChallenge.tsx |
Main game component with timer, input, and scoring |
app/kana/train/timed/page.tsx |
App Router entry point for timed mode |
- User selects kana characters from the Kana dojo.
- On starting the challenge, a 60-second timer begins.
- One kana character is shown at a time.
- User types the correct romaji and submits.
- Stats update in real time.
- When time runs out, a summary screen appears with retry option.
- Stats are tracked separately from regular modes to avoid overlap.
- Timer logic is handled via
useChallengeTimerhook. - Component is modular and can be extended to Kanji/Vocab dojos easily.
- All state updates are handled via Zustand for consistency.
PR: Adds Timed Challenge mode for Kana training. Includes stat tracking, timer logic, and App Router integration.