mirror of
https://github.com/deunix-educ/aventuriers-des-mots.git
synced 2026-10-13 02:11:58 +02:00
d057c8ee77
Introduces a generic JSON-Schema-subset validator in GDScript (scripts/data/schema_validator.gd) used both by `make validate-data` and, later, by ExerciseEngine at load time, plus semantic_checks.gd for cross-field constraints a schema can't express (answer index bounds, at least one faulty token in sentence correction, word count matching between a dictation's target_text and its annotations). Schemas cover rule, exercise (dispatched per type: multiple_choice, sentence_correction), dictation, curriculum, and save (save.schema.json is not yet wired into validate-data; saves live in user://, handled at the Profiles/Saves step). First draft content for the CE1 "accord_adjectif" rule (one rule, two multiple-choice exercises, one sentence correction, one dictation, one curriculum entry) exercises the full pipeline end to end and seeds docs/review/content-review.md, regenerated by the new tools/generate_content_review.py (`make content-review`). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
44 lines
1.3 KiB
JSON
44 lines
1.3 KiB
JSON
{
|
|
"type": "object",
|
|
"required": [
|
|
"id",
|
|
"level",
|
|
"domain",
|
|
"skill",
|
|
"rule_id",
|
|
"difficulty",
|
|
"type",
|
|
"instruction",
|
|
"question",
|
|
"answers",
|
|
"correct_answer",
|
|
"hint",
|
|
"explanation",
|
|
"review_tags",
|
|
"review_status"
|
|
],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"id": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$" },
|
|
"level": { "type": "string", "enum": ["CE1", "CE2"] },
|
|
"domain": { "type": "string", "enum": ["grammaire", "orthographe"] },
|
|
"skill": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$" },
|
|
"rule_id": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$" },
|
|
"difficulty": { "type": "integer", "minimum": 1, "maximum": 3 },
|
|
"type": { "type": "string", "const": "multiple_choice" },
|
|
"instruction": { "type": "string", "minLength": 1 },
|
|
"question": { "type": "string", "minLength": 1 },
|
|
"answers": {
|
|
"type": "array",
|
|
"minItems": 2,
|
|
"maxItems": 6,
|
|
"items": { "type": "string", "minLength": 1 }
|
|
},
|
|
"correct_answer": { "type": "integer", "minimum": 0 },
|
|
"hint": { "type": "string", "minLength": 1 },
|
|
"explanation": { "type": "string", "minLength": 1 },
|
|
"review_tags": { "type": "array", "items": { "type": "string" } },
|
|
"review_status": { "type": "string", "enum": ["draft", "validated"] }
|
|
}
|
|
}
|