Require capitalization and final punctuation again; add a UI reminder

Follow-up to the previous commit: testing further showed a missing
initial capital also fails validation, which raised the real
question (CLAUDE.md: ask rather than decide alone on an ambiguous
pedagogical point) — is sentence-initial capitalization and final
punctuation something the audio should convey, or a general writing
convention the child applies regardless of what they hear?

Decided: a general convention, like in a real classroom dictée. So
both stay required, and the terminal-punctuation tolerance added in
the previous commit is reverted (DictationAnalyzer back to comparing
the text as-is).

Since the audio still can't vocalize either rule, the child needs to
be told some other way: added a permanent reminder label to the
dictation scene ("N'oublie pas : une majuscule au début de la phrase
et un point à la fin !"), sourced from data/localization/fr.json.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Denis Defolie
2026-10-11 19:27:59 +02:00
parent 02755ced6f
commit 8a3469e7b1
8 changed files with 48 additions and 49 deletions
+6 -14
View File
@@ -67,21 +67,13 @@ func test_normalizes_before_comparing() -> void:
assert_true(result.is_correct)
## L'audio provisoire ne fait entendre aucune ponctuation (voir
## docs/specs/decisions.md, point 19/20) : l'omettre n'est pas une erreur.
func test_missing_terminal_punctuation_is_still_correct() -> void:
## Majuscule initiale et point final sont des conventions generales d'ecriture
## (voir docs/specs/decisions.md, point 22), exigees comme n'importe quel
## autre mot : l'enfant en est informe par un rappel affiche, pas par une
## tolerance a la correction.
func test_missing_terminal_punctuation_is_an_error() -> void:
var result := DictationAnalyzer.analyze(dictation, "Les petits chats dorment")
assert_true(result.is_correct)
func test_different_terminal_punctuation_is_still_correct() -> void:
var result := DictationAnalyzer.analyze(dictation, "Les petits chats dorment!")
assert_true(result.is_correct)
func test_terminal_punctuation_tolerance_does_not_hide_a_real_error_on_the_last_word() -> void:
var result := DictationAnalyzer.analyze(dictation, "Les petits chats dorme")
assert_false(result.is_correct)
assert_eq(result.errors.size(), 1)
assert_eq(result.errors[0]["found"], "dorme")
assert_eq(result.errors[0]["found"], "dorment")
assert_eq(result.errors[0]["expected"], "dorment.")
@@ -1,7 +1,8 @@
extends GutTest
## Reproduction d'un bug signale manuellement via exercise_host : la dictee
## "Les petits chats dorment." tapee exactement comme entendue n'etait pas
## validee comme correcte.
## Reproduction de deux retours de test manuel via exercise_host, sur la
## dictee "Les petits chats dorment." (voir docs/specs/decisions.md, points
## 21 et 22) : la reponse exacte doit valider, et la majuscule/le point final
## restent exiges (conventions generales d'ecriture, pas une tolerance).
var _profile_id: String = ""
@@ -30,10 +31,7 @@ func test_exact_target_text_is_validated_as_correct() -> void:
assert_eq(_feedback_title(host), UIText.get_text("feedback_panel.correct_title"))
## "J'entends parfaitement mais ne valide pas" : l'audio ne fait entendre
## aucune ponctuation, donc l'enfant qui ecrit exactement ce qu'il entend
## (sans le point final) doit tout de meme etre valide.
func test_missing_final_period_is_still_validated_as_correct() -> void:
func test_missing_final_period_is_not_validated_as_correct() -> void:
var host: Control = await _ready_host()
var exercise_scene: Control = host.get_node("%ExerciseContainer").get_child(0)
@@ -41,7 +39,7 @@ func test_missing_final_period_is_still_validated_as_correct() -> void:
exercise_scene.get_node("%ValidateButton").pressed.emit()
await wait_process_frames(1)
assert_eq(_feedback_title(host), UIText.get_text("feedback_panel.correct_title"))
assert_eq(_feedback_title(host), UIText.get_text("feedback_panel.incorrect_title"))
func _ready_host() -> Control: