Quizzes
95,105 views
25 min · 3 min read
7 steps
Intermediate

How to troubleshoot incorrect scoring in an online quiz app

Discovering that an online quiz app is scoring incorrectly is frustrating but fixable. This guide walks you through practical, step-by-step checks to isolate the problem and implement reliable fixes so scores match expectations. You’ll use simple tests, logs, and small code or configuration changes to get consistent results.

Verified by pleasexplain editors
  1. Step 1: Reproduce the problem consistently

    Run the same quiz 5–10 times with a controlled set of answers and document the results. Use different accounts, browser types, and one mobile device to see if the issue is environment-specific. Reproducing reliably narrows the cause to code, configuration, or client variability.

    [Illustration: person repeating quiz on laptop and phone with checklist]

  2. Step 2: Check answer key and data mapping

    Compare the stored answer key to the displayed questions and option IDs for at least 10 items. Ensure option identifiers (e.g., A,B,C or numeric IDs) match the scoring logic and that any recent content updates kept mapping intact. Mismapped IDs are a common source of off-by-one or swapped-score errors.

    [Illustration: spreadsheet comparing question IDs and correct answer IDs]

  3. Step 3: Validate request and response payloads

    Use browser dev tools or an API inspector to capture the submit request and server response for 3–5 sample attempts. Confirm that submitted answers are sent intact and that the server returns the expected score and per-question feedback. Network-level corruption or client-side mutation can alter answers before scoring.

    [Illustration: network tab showing JSON payload exchange between client and server]

  4. Step 4: Review scoring logic and edge cases

    Audit the scoring function for ties, partial-credit rules, negative marking, and rounding behavior with at least 8 sample scenarios. Create unit tests that assert expected scores for each scenario. Edge-case rules are often inconsistently applied, causing apparent random errors.

    [Illustration: developer reviewing code with highlighted scoring rules and test cases]

  5. Step 5: Check time-based and session effects

    Test quizzes with time limits and session expirations by submitting answers at the 0s, 50% and 95% time marks. Verify whether late submissions, token refreshes, or session rollovers change the computed score. Timeouts and session mismatches frequently lead to dropped or duplicated responses.

    [Illustration: timer counting down beside a quiz form and session token icon]

  6. Step 6: Inspect database transactions and race conditions

    Look at server logs for 50–100 recent submissions and search for duplicate writes, failed transactions, or overlapping requests. Simulate concurrent submits from 2–4 clients to see if race conditions overwrite correct answers. Locking and transaction issues can corrupt final stored scores.

    [Illustration: server logs with timestamps and concurrent request markers]

  7. Step 7: Deploy fixes incrementally and monitor

    Apply one change at a time (configuration, code patch, or validation rule) and run 25–50 regression attempts with automated tests and real users if possible. Monitor error rates and score variance for 24–72 hours before rolling out broadly. Incremental deployment isolates which change resolved the issue.

    [Illustration: Deploy fixes incrementally and monitor]


  • Keep a reproducible bug report with screenshots, exact steps, and request payloads for faster debugging.
  • Create a test account and a set of canned answers to run automated regression checks after each change.
  • Log per-question scoring decisions with timestamps for 7–14 days to gather evidence without overwhelming storage.
  • Use version control and feature flags to roll back any change within 30 minutes if it introduces new issues.
  • Include end-to-end tests that cover partial credit, negative marks, and unanswered questions to prevent regressions.
  • Establish a simple checklist for content editors to verify mappings after every content import or MCQ edit.

  • Avoid changing multiple scoring rules at once; doing so makes it impossible to identify the cause of improvement or regression.
  • Do not clear production logs immediately; keep at least 14 days of recent logs to investigate intermittent problems.
  • Never trust a single browser test; cross-check on at least 3 browsers or devices before declaring a fix is complete.

Was this guide helpful?