{
  "$id": "question-comp.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$ref": "contentitem.schema.json",
  "title": "Question Component",
  "description": "A question item that can contain various types of assessment questions",
  "type": "object",
  "additionalProperties": true,
  "required": [ "type", "questionjson" ],
  "properties": {
    "type": {
      "type": "string",
      "const": "question",
      "description": "Should be always set to 'question' to identify this as a question component"
    },
    "questionjson": {
      "description": "The question content in Learnosity format. The structure varies by question type (mcq, clozedropdown, shorttext, etc.).",
      "type": "object",
      "oneOf": [
        { "$ref": "mcq_single_select.schema.json" },
        { "$ref": "mcq_multiple_select.schema.json" },
        { "$ref": "clozedropdown.schema.json" },
        { "$ref": "clozetext.schema.json" },
        { "$ref": "clozeformula.schema.json" },
        { "$ref": "clozeformulav2.schema.json" },
        { "$ref": "association.schema.json" },
        { "$ref": "clozeassociation.schema.json" },
        { "$ref": "classification.schema.json" },
        { "$ref": "orderlist.schema.json" },
        { "$ref": "graphplotting.schema.json" },
        { "$ref": "numberlineplot.schema.json" },
        { "$ref": "numberline.schema.json" },
        { "$ref": "simplechart.schema.json" },
        { "$ref": "shorttext.schema.json" },
        { "$ref": "longtextV2.schema.json" },
        { "$ref": "plaintext.schema.json" },
        { "$ref": "imageclozeassociationV2.schema.json" },
        { "$ref": "imageclozedropdown.schema.json" },
        { "$ref": "imageclozeformulaV2.schema.json" },
        { "$ref": "imageclozeformula.schema.json" },
        { "$ref": "imageclozetext.schema.json" }
      ]
    },
    "help": {
      "type": [ "array", "null" ],
      "items": { "$ref": "questionhelp.schema.json" },
      "description": "Optional array of help items or null"
    },
    "feedback": {
      "type": [ "array", "null" ],
      "items": { "$ref": "questionfeedback.schema.json" },
      "description": "Optional array of feedback items or null"
    },
    "answerexplanation": {
      "type": "object",
      "$ref": "questionanswerexplanation.schema.json"
    },
    "answerrationale": {
      "type": "object",
      "$ref": "questionanswerrationale.schema.json"
    },
    "metadata": {
      "type": "array",
      "items": { "$ref": "question-metadata.schema.json" },
      "uniqueItems": true
    }
  }
}
