{
  "$schema" : "https://json-schema.org/draft/2019-09/schema#",
  "$id" : "https://purl.imsglobal.org/spec/eduapiGradebook/v1p0/schema/json/eduapiGradebook_v1p0_scorescale-jsonschema1.json",
  "title" : "JSON Schema for the ScoreScale class.",
  "description" : "Represents the definition of a score scale mapping, e.g. the relationship between values in one score scale and values in another.",
  "type" : "object",
  "properties" : {
    "sourcedId" : {
      "description" : "The sourcedId of the object. This is the interoperability identifier that systems will refer to when making API calls, or when needing to identify an object. Systems SHOULD be able to map whichever local ids (e.g. database key fields) they use to sourcedId. The sourcedId of an object MUST be an anonymized or pseudonymized identifier of an entity and as such will not contain Personally Identifiable Information (PII) or Personal Data (PD).",
      "$comment" : "Origin: GUID (DerivedType); The data-type for establishing a Globally Unique Identifier (GUID). There is no predefined structure for the GUID.",
      "type" : "string"
    },
    "recordLanguage" : {
      "description" : "The primary language used in the described entity.",
      "$comment" : "Origin: LanguageCode (DerivedType); A language code [[BCP47]].",
      "type" : "string",
      "pattern" : "^[a-z]{2,4}(-[A-Z][a-z]{3})?(-([A-Z]{2}|[0-9]{3}))?$"
    },
    "recordStatus" : {
      "description" : "The status of this record. The record has been, or will immediately be, removed from the upstream system; downstream systems can also remove this record as it won't be used again.",
      "$comment" : "Origin: RecordStatusTypeEnum (Enum); The set of values to describe the state of a record in the source system. For systems migrating from, or making use of OneRoster, deleted is to be considered synonymous with toBeDeleted.",
      "type" : "string",
      "enum" : [ "active", "deleted", "inactive" ]
    },
    "dateLastModified" : {
      "description" : "A timestamp describing when this record was last modified.",
      "$comment" : "Origin: DateTimeZ (DerivedType); A `DateTime` with the trailing timezone specifier included, e.g. `2021-09-07T02:09:59+02:00`",
      "type" : "string",
      "format" : "date-time"
    },
    "extensions" : {
      "$ref" : "#/$defs/scoreScaleExtensions"
    },
    "title" : {
      "type" : "array",
      "minItems" : 1,
      "items" : {
        "$ref" : "#/$defs/LanguageTypedString"
      }
    },
    "type" : {
      "description" : "The type of score scale mapping. At present there is no predefined vocabulary. This should be used by an organization to differentiate between the score scales that it produces.",
      "$comment" : "Origin: NormalizedString (PrimitiveType); A `String` conforming to the `normalizedString` definition in [[XMLSCHEMA11-2]].",
      "type" : "string"
    },
    "scoreScaleValue" : {
      "type" : "array",
      "minItems" : 1,
      "items" : {
        "$ref" : "#/$defs/ScoreScaleValue"
      }
    }
  },
  "required" : [ "sourcedId", "recordLanguage", "recordStatus", "title", "type", "scoreScaleValue" ],
  "additionalProperties" : false,
  "$defs" : {
    "LanguageTypedString" : {
      "description" : "A String with an associated language code.",
      "type" : "object",
      "properties" : {
        "recordLanguage" : {
          "description" : "The primary language used in the described entity.",
          "$comment" : "Origin: LanguageCode (DerivedType); A language code [[BCP47]].",
          "type" : "string",
          "pattern" : "^[a-z]{2,4}(-[A-Z][a-z]{3})?(-([A-Z]{2}|[0-9]{3}))?$"
        },
        "value" : {
          "description" : "The string value.",
          "$comment" : "Origin: String (PrimitiveType); Character strings.",
          "type" : "string"
        }
      },
      "required" : [ "recordLanguage", "value" ],
      "additionalProperties" : false
    },
    "ScoreScaleValue" : {
      "description" : "A specific mapping of values between two score scales. The left hand side (LHS) value is the reference point. Examples of this mapping are: '7' maps to 'A', '7'-'10' maps to 'A', etc.",
      "type" : "object",
      "properties" : {
        "itemValueLHS" : {
          "description" : "The left hand side value of the mapping relationship. The format is either a single value ('x') or a range ('x' - 'y'). In the case of a single value this is considered to be the inclusive lower value for the implied range. When a range is specified (lower-to-upper) the values are inclusive.",
          "$comment" : "Origin: NormalizedString (PrimitiveType); A `String` conforming to the `normalizedString` definition in [[XMLSCHEMA11-2]].",
          "type" : "string"
        },
        "itemValueRHS" : {
          "description" : "The right hand side value of the mapping relationship i.e. the equivalent value to the reference point defined in the LHS.",
          "$comment" : "Origin: NormalizedString (PrimitiveType); A `String` conforming to the `normalizedString` definition in [[XMLSCHEMA11-2]].",
          "type" : "string"
        }
      },
      "required" : [ "itemValueLHS", "itemValueRHS" ],
      "additionalProperties" : false
    },
    "scoreScaleExtensions" : {
      "description" : "Extension properties related to score scales",
      "type" : "object",
      "properties" : { },
      "required" : [ ],
      "additionalProperties" : true
    }
  }
}