mirror of
https://github.com/deunix-educ/aventuriers-des-mots.git
synced 2026-10-13 02:11:58 +02:00
91dcd7e07a
AnswerValidator.validate_sentence_correction compared the typed correction to the expected word with raw string equality, with none of the tolerance already built for dictations: no case folding, no typographic-apostrophe or whitespace normalization, no decomposed- accent handling. Tapping "petit" and typing "petits" could fail for reasons having nothing to do with the grammar point being tested (e.g. a stray capital from autocapitalization), which violates the "an ambiguous answer is never auto-marked wrong" invariant. Found this while chasing a manual bug report: an automated test reproducing the user's exact click sequence (tap once, type, submit) did NOT reproduce the failure, which actually pointed at the real gap -- the logic worked for byte-identical input, but had zero tolerance for anything else. Now reuses TextNormalizer (built for dictation analysis) before comparing, case-insensitively, while still showing the child's raw typed text in the feedback. Three new tests cover case, incidental whitespace, and decomposed accents. Rebuilt both exports so the shipped binaries include the fix. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>