{
  "$id": "clozedropdown.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Cloze Dropdown Question",
  "description": "Learnosity cloze dropdown question type extending the base Learnosity schema",
  "$ref": "learnosity-question-base.schema.json",
  "type": "object",
  "required": ["template", "stimulus", "possible_responses", "ui_style", "is_math", "feedback_attempts"],
  "properties": {
    "type": {
      "const": "clozedropdown",
      "description": "Question type identifier for cloze dropdown"
    },
    "stimulus": {
      "type": "string",
      "description": "Optional introductory text or instructions before the template"
    },
    "template": {
      "type": "string",
      "description": "Question text with {{response}} placeholders for dropdowns. Each {{response}} creates a dropdown at that position."
    },
    "possible_responses": {
      "type": "array",
      "description": "An array of dropdown option sets. Each inner array corresponds to one {{response}} placeholder in the template, containing the possible options for that dropdown in order.",
      "minItems": 1,
      "items": {
        "type": "array",
        "minItems": 1,
        "items": {
          "type": "string",
          "description": "A single option displayed in the dropdown."
        },
        "uniqueItems": true,
        "description": "Options for a single {{response}} placeholder."
      }
    },
    "ui_style": {
      "allOf": [
        { "$ref": "ui_style.schema.json" },
        { "required": ["validation_stem_numeration"] }
      ]
    },
    "is_math": {
      "type": "boolean",
      "description": "Whether this question contains mathematical content"
    },
    "multiple_responses": {
      "type": "boolean",
      "description": "Typically not used for clozedropdown. Reserved for compatibility."
    },
    "feedback_attempts": {
      "type": ["integer", "string"],
      "description": "Number of attempts before showing feedback"
    }
  }
}
