{
  "$id": "imageclozeassociationV2.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "ImageClozeAssociationV2 Question Schema",
  "description": "Schema for ImageClozeAssociationV2 question type, supporting image-based cloze association with response containers.",
  "$ref": "learnosity-question-base.schema.json",
  "type": "object",
  "required": ["stimulus", "image", "possible_responses", "response_containers"],
  "properties": {
    "type": { "const": "imageclozeassociationV2" },
    "stimulus": {
      "type": "string",
      "description": "The question prompt or stimulus."
    },
    "image": {
      "type": "object",
      "properties": {
        "src": {
          "type": "string",
          "description": "URL or path to the image source"
        },
        "width": {
          "type": "number",
          "minimum": 1,
          "description": "Width of the image in pixels"
        },
        "height": {
          "type": "number",
          "minimum": 1,
          "description": "Height of the image in pixels"
        }
      },
      "required": ["src", "width", "height"],
      "additionalProperties": false
    },
    "possible_responses": {
      "type": "array",
      "items": { "type": "string" },
      "minItems": 1,
      "description": "List of possible response choices for the association"
    },
    "response_containers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "x": {
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "description": "X coordinate position as percentage"
          },
          "y": {
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "description": "Y coordinate position as percentage"
          },
          "width": {
            "type": "string",
            "description": "Width of the response container as percentage"
          },
          "height": {
            "type": "string",
            "description": "Height of the response container as percentage"
          },
          "aria_label": {
            "type": "string",
            "description": "Accessibility label for the response container"
          }
        },
        "required": ["x", "y", "width", "height", "aria_label"],
        "additionalProperties": false
      },
      "minItems": 1,
      "description": "Array of response container positions and dimensions"
    },
    "ui_style": {
      "allOf": [
        { "$ref": "ui_style.schema.json" }
      ]
    }
  },
  "additionalProperties": true
}