{
  "$id": "imageclozedropdown.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "ImageClozeDropdown Question Schema",
  "description": "Schema for ImageClozeDropdown question type, supporting image-based cloze with dropdown selections at positioned locations.",
  "$ref": "learnosity-question-base.schema.json",
  "type": "object",
  "required": ["stimulus", "image", "possible_responses", "response_positions", "aria_labels",  "response_container"],
  "properties": {
    "type": { "const": "imageclozedropdown" },
    "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": "array",
        "items": { "type": "string" }
      },
      "minItems": 1,
      "description": "Array of arrays containing possible response choices for each dropdown"
    },
    "response_container": {
      "type": "object",
      "properties": {
        "pointer": {
          "type": "string",
          "enum": ["left", "right", "top", "bottom"],
          "description": "Direction of the dropdown pointer"
        },
        "vertical_top": {
          "type": "boolean",
          "description": "Whether to align dropdown to top vertically"
        }
      },
      "additionalProperties": true
    },
    "response_positions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "x": {
            "type": "number",
            "minimum": 0,
            "description": "X coordinate position for the dropdown"
          },
          "y": {
            "type": "number",
            "minimum": 0,
            "description": "Y coordinate position for the dropdown"
          }
        },
        "required": ["x", "y"],
        "additionalProperties": false
      },
      "minItems": 1,
      "description": "Array of position coordinates for dropdown placement"
    },
    "aria_labels": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Array of accessibility labels for each dropdown"
    },
    "ui_style": {
      "allOf": [
        { "$ref": "ui_style.schema.json" }
      ]
    }
  },
  "additionalProperties": true
}