Skip to content

fix: use consistent 2 d.p. rounding in answer checks (closes #179) - #396

Open
jindal-sneha wants to merge 1 commit into
vicharanashala:mainfrom
jindal-sneha:fix/issue-179
Open

jindal-sneha wants to merge 1 commit into
vicharanashala:mainfrom
jindal-sneha:fix/issue-179

Conversation

@jindal-sneha

Copy link
Copy Markdown

Closes #179

Problem

Answer validation and displayed answers used different rounding rules:

  • TEN-MATH-022 (Mensuration): 46.10 was accepted but feedback showed 46.08, because the check allowed a tolerance of 0.5.
  • TEN-MATH-019 (Speed/Distance/Time): the wording said "to 2 d.p. if needed" while the check rejected 43 and expected 43.13.

Changes

  • server/routes/geometry.js (mensur check): compare answers rounded to 2 d.p. instead of a 0.5 tolerance.
  • server/routes/misc.js (cyclist average-speed question): clarified wording to "Give your answer correct to 2 decimal places." and changed the check to compare at 2 d.p. instead of a 0.05 tolerance.

Testing

  • Verified the comparison logic with Node: 46.10 vs 46.08 is rejected, 46.08 is accepted; 43 vs 43.13 is rejected, 43.13 is accepted.
  • Did not run the full app end to end.

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

✅ Parikshak — all automated checks pass

This is Parikshak, an automated, comment-only check — it never closes or approves a PR. A human reviewer still makes the final call. See CONTRIBUTING.md for the full contribution rules.

@sipmap

sipmap Bot commented Oct 8, 2026

Copy link
Copy Markdown

🎉 Welcome @jindal-sneha — this looks like your first pull request in this repo!

A few friendly tips:

  • Make sure CI checks pass
  • Add tests if you changed source files
  • Update docs / CHANGELOG if relevant
  • Be patient waiting for review — maintainers are volunteers 💚

If you get stuck, ask away in the PR comments. Good luck!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validator and displayed answer use different rounding rules (TEN-MATH-019, 022)

1 participant