{
  "$id": "clozeassociation.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Cloze Association Question",
  "description": "Learnosity cloze association question type for drag-and-drop ordering within a template, extending the base Learnosity schema",
  "$ref": "learnosity-question-base.schema.json",
  "type": "object",
  "required": ["template", "possible_responses", "feedback_attempts", "ui_style", "is_math"],
  "properties": {
    "type": {
      "const": "clozeassociation",
      "description": "Question type identifier for cloze association questions"
    },
    "stimulus": {
      "type": "string",
      "description": "Optional introductory text or instructions for the cloze association task"
    },
    "template": {
      "type": "string",
      "description": "Question text with {{response}} placeholders. Each {{response}} corresponds to a drop zone where students can place draggable items."
    },
    "possible_responses": {
      "type": "array",
      "description": "Array of draggable response options that can be placed in the template drop zones",
      "minItems": 2,
      "items": {
        "type": "string",
        "description": "Individual draggable response option"
      }
    },
    "feedback_attempts": {
      "type": ["integer", "string"],
      "description": "Number of attempts before showing feedback"
    },
    "ui_style": {
      "allOf": [
        { "$ref": "ui_style.schema.json" },
        { "required": ["possibility_list_position"] }
      ]
    },
    "is_math": {
      "type": "boolean",
      "description": "Whether this question contains mathematical content"
    }
  },
  "additionalProperties": true
}