{
  "$id": "association.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Association Question",
  "description": "Learnosity association question type for matching stimuli with responses, extending the base Learnosity schema",
  "$ref": "learnosity-question-base.schema.json",
  "type": "object",
  "required": ["stimulus", "stimulus_list", "possible_responses", "feedback_attempts", "ui_style", "is_math"],
  "properties": {
    "type": {
      "const": "association",
      "description": "Question type identifier for association questions"
    },
    "stimulus": {
      "type": "string",
      "description": "The question text or instructions for the association task"
    },
    "stimulus_list": {
      "type": "array",
      "description": "Array of terms or items to be matched",
      "minItems": 2,
      "items": {
        "type": "string",
        "description": "Individual stimulus item to be matched"
      }
    },
    "possible_responses": {
      "type": "array",
      "description": "Array of possible response options that can be matched with stimuli",
      "minItems": 2,
      "items": {
        "type": "string",
        "description": "Individual response option available for matching"
      }
    },
    "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
}
