Add CE2 homophones chapter (a/à, et/est, son/sont, on/ont)

Same directives as the CE1 chapter: 4 rules with a substitution test
each, 8 multiple-choice + 4 sentence corrections + 3 dictées per rule
(draft), 3 missions per rule, Piper audio for the 12 dictées.

21 missions don't fit on one map, so the world map now shows the
missions of the profile's school level (derived from the rule's level,
no data-format change), with a button letting a CE2 profile revisit the
CE1 map. Mission-position guard test now checks each level separately.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Denis Defolie
2026-10-11 21:58:16 +02:00
parent 233cc26452
commit aad229ef7b
113 changed files with 2814 additions and 31 deletions
+26 -22
View File
@@ -1,28 +1,32 @@
extends GutTest
## Garde-fou contre le chevauchement de marqueurs sur la carte (signale
## manuellement : "La clairiere" et "La cabane" se chevauchaient, voir
## docs/specs/decisions.md). scenes/world/world_map.gd place chaque marqueur
## a une position fractionnelle (map_position.x/y de data/missions/*.json) ;
## sans ecart suffisant entre deux missions, leurs boutons se recouvrent a
## l'ecran. Verifie l'ecart plutot que le rendu reel (non testable sans
## ecran), avec une marge volontairement un peu permissive par rapport a la
## grille 0.35 utilisee dans les donnees.
## docs/specs/decisions.md, point 26). scenes/world/world_map.gd place chaque
## marqueur a une position fractionnelle (map_position.x/y de
## data/missions/*.json) ; sans ecart suffisant entre deux missions affichees
## ensemble (meme niveau), leurs boutons se recouvrent a l'ecran. Verifie
## l'ecart plutot que le rendu reel (non testable sans ecran), a la
## resolution par defaut (1152 px de large : 0.2 = 230 px pour des
## marqueurs de 160 px ; 0.3 de hauteur pour des marqueurs de 72 px).
const MIN_FRACTIONAL_GAP := 0.3
const MIN_GAP_X := 0.2
const MIN_GAP_Y := 0.3
func test_mission_markers_do_not_overlap() -> void:
var missions := ExerciseEngine.get_missions()
for i in missions.size():
for j in range(i + 1, missions.size()):
var a: Dictionary = missions[i]["map_position"]
var b: Dictionary = missions[j]["map_position"]
var dx: float = abs(float(a["x"]) - float(b["x"]))
var dy: float = abs(float(a["y"]) - float(b["y"]))
assert_true(
dx >= MIN_FRACTIONAL_GAP or dy >= MIN_FRACTIONAL_GAP,
(
"%s et %s sont trop proches (dx=%s, dy=%s)"
% [missions[i]["mission_id"], missions[j]["mission_id"], dx, dy]
),
)
func test_mission_markers_do_not_overlap_within_a_level() -> void:
for level in ["CE1", "CE2"]:
var missions := ExerciseEngine.get_missions_for_level(level)
assert_false(missions.is_empty(), "aucune mission pour %s" % level)
for i in missions.size():
for j in range(i + 1, missions.size()):
var a: Dictionary = missions[i]["map_position"]
var b: Dictionary = missions[j]["map_position"]
var dx: float = abs(float(a["x"]) - float(b["x"]))
var dy: float = abs(float(a["y"]) - float(b["y"]))
assert_true(
dx >= MIN_GAP_X or dy >= MIN_GAP_Y,
(
"%s et %s sont trop proches (dx=%s, dy=%s)"
% [missions[i]["mission_id"], missions[j]["mission_id"], dx, dy]
),
)