mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-06 19:17:25 +08:00
Short answers were fuzzy-matched with SequenceMatcher >= 0.85, so "1250.60" passed for "1250.50", "-200" for "200" and "x=3, y=4" for "x=3, y=5", while "1.250,50", "1250,50 €" and "1/8" were rejected for "1250.50" / "0.125". Mastery's exact_verdict only compared casefolded strings and left every number to an LLM verdict. Add numeric_equivalent() to learning/grading.py: locale-aware decimal and grouping separators with an explicit ambiguity rule, sign, currency, percent, unit, fraction and scientific notation parsing, tolerance from the key's written precision, and labelled/positional multi-part comparison. grade_answer never fuzzy-matches a numeric key, and exact_verdict returns a final verdict for numeric matches and for unambiguous numeric mismatches on short questions. Test vectors live in tests/fixtures/numeric_answers.json so the web port can share them. Signed-off-by: Benjamin Schwing <63053132+BenjiAvH@users.noreply.github.com>