{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://lc-json.org/1.1-rc.1/item-base.schema.json",
  "title": "LessonItem Base Schema",
  "description": "Common properties for all lesson item types (content, exercise, quiz, contentsequence, signpost)",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "description": "Item type discriminator (MUST be first property)",
      "enum": [
        "content",
        "exercise",
        "quiz",
        "contentsequence",
        "signpost"
      ]
    },
    "id": {
      "type": "integer",
      "description": "Local database identifier (auto-assigned if missing)",
      "minimum": 0,
      "default": 0
    },
    "globalId": {
      "type": "string",
      "description": "Stable RFC 4122 UUID identifying this item across re-imports. Required by NORMATIVE §4.4: every Unit, Lesson, Item, and Question MUST carry a globalId.",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
    },
    "title": {
      "type": "string",
      "description": "Item title",
      "minLength": 1
    },
    "tags": {
      "type": "array",
      "description": "Optional taxonomic tags for filtering, search, and gradebook grouping. Free-form strings; conventional namespaces use colons (e.g. 'history:immigration:united-states', 'grade:9', 'stage:lower-secondary'). Independent of any tags on inner questions. For ContentSequenceItem, consumer applications may surface only the CSI's own tags, ignore them in favor of the related items' tags, or combine both — that policy is consumer-defined and not specified here.",
      "items": {
        "type": "string",
        "minLength": 1
      },
      "default": []
    },
    "sequence": {
      "type": "integer",
      "description": "Display order within lesson (0-based)",
      "minimum": 0,
      "default": 0
    },
    "instructions": {
      "type": "string",
      "description": "Instructions or description for this item",
      "default": ""
    },
    "suggestedTime": {
      "type": "integer",
      "description": "Suggested completion time in minutes",
      "minimum": 0,
      "default": 0
    },
    "isOptional": {
      "type": "boolean",
      "description": "Whether this item is optional (can be skipped)",
      "default": false
    },
    "rules": {
      "type": [
        "object",
        "null"
      ],
      "description": "Navigation rules (prerequisite conditions, etc.)",
      "default": null
    }
  },
  "required": [
    "type",
    "globalId",
    "title"
  ]
}
