{
  "contract_version": "gab_135_contract_v1",
  "gab_id": "GAB-135",
  "canonical_name": "ExerciseImageQuestion",
  "module_owner": "EdTechExerciseLearning",
  "renderer_key": "text_cta",
  "required_fields": [
    "gab_id",
    "exercise_id",
    "instruction",
    "question",
    "options",
    "correct_answer_id"
  ],
  "optional_fields": [
    "title",
    "image_src",
    "image_alt",
    "image_caption",
    "hotspots",
    "feedback_correct",
    "feedback_incorrect",
    "primary_cta",
    "accessibility"
  ],
  "field_types": {
    "instruction": "string — libellé d'invite (ex: 'Observe l'image et réponds')",
    "image_src": "string (URL) — absent ou préfixé '_TODO:' si image non fournie ; le moteur affiche un placeholder visuel",
    "image_alt": "string — texte alternatif obligatoire pour accessibilité (WCAG 2.1 AA)",
    "image_caption": "string — légende optionnelle sous l'image",
    "hotspots": "array<{id, label, color, top_pct:number(0..100), left_pct:number(0..100)}> — points repères cliquables positionnés en % relatif à l'image",
    "options": "array<{id, label, correct:boolean}> — au moins 2 options, une seule correct:true",
    "correct_answer_id": "string — doit correspondre à un id dans options[]",
    "feedback_correct": "string — feedback affiché si bonne réponse",
    "feedback_incorrect": "string — feedback affiché si mauvaise réponse",
    "primary_cta": "object{label, action} — libellé et action du bouton de validation",
    "accessibility": "object{image_alt_required:boolean, hotspot_titles:boolean, keyboard_navigable:boolean}"
  },
  "constraints": [
    "Une et une seule option porte correct:true dans options[].",
    "correct_answer_id doit référencer un id existant dans options[].",
    "image_alt obligatoire si image_src fourni (accessibilité WCAG).",
    "hotspots positionnés en pourcentage relatif à l'image (top_pct, left_pct dans [0,100]).",
    "primary_cta : libellé venant du JSON, structure bouton fournie par le HTML.",
    "Aucun contenu pédagogique en dur dans le renderer — tout vient de l'instance."
  ],
  "blocked_conditions": [
    "instruction absente (BLOCKED)",
    "question absente (BLOCKED)",
    "options absentes ou tableau vide (BLOCKED)",
    "correct_answer_id absent (BLOCKED)"
  ],
  "accessibility": [
    "keyboard_navigable",
    "focus_visible",
    "prefers_reduced_motion",
    "hotspot_aria_label",
    "image_alt_text"
  ],
  "qa_cases": [
    { "case": "instance conforme", "expected": "rendu complet, hotspots et options affichés, 0 erreur" },
    { "case": "instruction absente", "expected": "BLOCKED affiché dans la carte principale" },
    { "case": "options tableau vide", "expected": "BLOCKED affiché dans la carte principale" },
    { "case": "correct_answer_id absent", "expected": "BLOCKED affiché dans la carte principale" },
    { "case": "image_src absent / _TODO", "expected": "placeholder visuel SVG généré, pas d'erreur" },
    { "case": "instance externe injectée via ENGINE.init(ext)", "expected": "rendu change sans modifier le HTML" },
    { "case": "responsive 375/768/1024", "expected": "aucun débordement horizontal, image proportionnelle" },
    { "case": "clic hotspot puis valider bonne réponse", "expected": "option marquée .ok, feedback_correct affiché" },
    { "case": "clic hotspot puis valider mauvaise réponse", "expected": "option sélectionnée .ko, bonne option .ok, feedback_incorrect affiché" }
  ],
  "traceability": {
    "derived_from_core_gab": "GAB-135",
    "note": "Ce schema VALIDE l'instance. Le contrat pédagogique complet (input_contract/validation_logic/feedback_scoring_logic) vit dans le CORE-GAB officiel, pas ici (évite la duplication)."
  }
}
