{
  "$id": "clozeformula.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Cloze Formula Question",
  "description": "Learnosity cloze formula question type extending the base Learnosity schema",
  "$ref": "learnosity-question-base.schema.json",
  "type": "object",
  "required": ["template", "ui_style", "is_math", "response_containers", "feedback_attempts"],
  "properties": {
    "type": {
      "const": "clozeformula",
      "description": "Question type identifier for cloze formula"
    },
    "stimulus": {
      "type": "string",
      "description": "Optional introductory text or instructions before the template"
    },
    "template": {
      "type": "string",
      "description": "Question text with {{response}} placeholders. Each {{response}} corresponds to a formula input for students."
    },
    "ui_style": {
      "allOf": [
        { "$ref": "ui_style.schema.json" },
        { "required": ["validation_stem_numeration", "type"] }
      ]
    },
    "is_math": {
      "type": "boolean",
      "description": "Whether this question contains mathematical content (typically true for clozeformula)"
    },
    "response_containers": {
      "type": "array",
      "description": "Array of response container configurations for formula inputs",
      "items": {
        "type": "object",
        "description": "Configuration for a single response container"
      }
    },
    "validation": {
      "$ref": "clozeformula-validation.schema.json"
    },
    "feedback_attempts": {
      "type": ["integer", "string"],
      "description": "Number of attempts before showing feedback"
    }
  }
}
