{
  "$id": "assessment-metadata.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$ref": "metadata.schema.json",
  "additionalProperties": false,
  "allOf": [
    {
      "if": { "properties": { "key": { "const": "meta:GradeWeightCategory" } } },
      "then": {
        "properties": {
          "value": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1,
            "items": {
              "type": "string",
              "enum": [
                "Instruction",
                "Assignments",
                "Short Writing",
                "Essay",
                "Project",
                "Lab Report",
                "Performance Task",
                "Offline Written Response",
                "Speaking Activity",
                "Practice Assessment",
                "Quiz",
                "Test",
                "Exam",
                "Speaking and Writing Assessment"
              ]
            }
          }
        }
      }
    },
    {
      "if": { "properties": { "key": { "const": "meta:CountedTowardsCourseGrade" } } },
      "then": {
        "properties": {
          "value": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1,
            "items": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        }
      }
    },
    {
      "if": { "properties": { "key": { "const": "meta:AssessmentSubtype" } } },
      "then": {
        "properties": {
          "value": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1,
            "items": {
              "type": "string",
              "enum": [
                "Practice Test",
                "Practice Exam",
                "Quiz",
                "Test",
                "Exam",
                "Pre-Quiz",
                "Post-Quiz"
              ]
            }
          }
        }
      }
    },
    {
      "if": { "properties": { "key": { "const": "meta:AssessmentType" } } },
      "then": {
        "properties": {
          "value": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1,
            "items": {
              "type": "string",
              "enum": [
                "Dynamically Delivered",
                "Fixed Form",
                "Benchmark",
                "Adaptive"
              ]
            }
          }
        }
      }
    },
    {
      "if": { "properties": { "key": { "const": "meta:CompletionTime" } } },
      "then": {
        "properties": {
          "value": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1,
            "items": {
              "type": "string"
            }
          }
        }
      }
    },
    {
      "if": { "properties": { "key": { "const": "meta:Product" } } },
      "then": {
        "properties": {
          "value": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1,
            "items": {
              "type": "string",
              "enum": [
                "MPNG",
                "EdgeEX",
                "Project Link",
                "ImaginePlus Math",
                "Imagine Language and Literacy"
              ]
            }
          }
        }
      }
    }
  ],
  "properties": {
    "key": {
      "type": "string",
      "enum": [
        "meta:Product",
        "meta:CompletionTime",
        "meta:AssessmentType",
        "meta:AssessmentSubtype",
        "meta:CountedTowardsCourseGrade",
        "meta:GradeWeightCategory"
      ]
    },
    "value": {
      "type": "array",
      "minItems": 1,
      "items": { "type": "string" }
    }
  },
  "required": [ "key", "value" ],
  "title": "Assessment Metadata",
  "type": "object"
}
