Review CM1/CM2 content: fix ambiguities, hints, final punctuation in corrections (0.8.2)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Denis Defolie
2026-10-12 12:01:21 +02:00
parent 8584249d78
commit a91d9e528c
27 changed files with 111 additions and 77 deletions
+21
View File
@@ -149,3 +149,24 @@ func test_expected_without_elision_accepts_the_prefix_of_the_touched_word() -> v
for typed in ["achèterais", "j'achèterais"]:
var result := AnswerValidator.validate_sentence_correction(exercise, [1], {1: typed})
assert_true(result.is_correct, "« %s » doit etre accepte" % typed)
func test_correction_does_not_require_the_final_punctuation_of_the_word() -> void:
# Le mot touche porte souvent le point de la phrase (« roze. ») : taper
# « rose » ou « rose. » est correct, « roze » ne l'est pas.
var exercise := {
"rule_id": "regle_x",
"hint": "indice",
"explanation": "explication",
"tokens":
[
{"text": "La", "correct": true},
{"text": "roze.", "correct": false, "expected": "rose."},
],
}
for typed in ["rose", "rose.", "Rose", " rose "]:
var result := AnswerValidator.validate_sentence_correction(exercise, [1], {1: typed})
assert_true(result.is_correct, "« %s » doit etre accepte" % typed)
for typed in ["roze", "roze.", "rosse", ""]:
var result := AnswerValidator.validate_sentence_correction(exercise, [1], {1: typed})
assert_false(result.is_correct, "« %s » ne doit pas etre accepte" % typed)