Root cause: setQuizMode(mode) was called BEFORE the network fetch completed. React immediately re-rendered showing the quiz, but quiz.questions still had the initial load data (without correct_answer for study mode). On fast desktop networks the fetch completed before the user could tap; on slower mobile networks the user tapped an option while correct_answer was still null, making every answer appear incorrect. Fix: setQuizMode(mode) moved to AFTER setQuiz(quizRes.data) and setAttemptId(). The ModeSelectScreen stays visible while data loads, then switches to the quiz view only when all data (including correct_answer) is ready. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| .dockerignore | ||
| Dockerfile | ||
| index.html | ||
| nginx.conf | ||
| package.json | ||
| vite.config.js | ||