{
  "$schema" : "https://json-schema.org/draft/2019-09/schema#",
  "$id" : "https://purl.imsglobal.org/spec/eduapiGradebook/v1p0/schema/json/eduapiGradebook_v1p0_result-jsonschema1.json",
  "title" : "JSON Schema for the Result class.",
  "description" : "Represents the score or grade for a person on a LineItem, together with the context required to interpret that result.",
  "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/resultExtensions"
    },
    "lineItem" : {
      "description" : "The GUID of the LineItem to which the result is aligned.",
      "$comment" : "Origin: LineItemGUIDRef (DerivedType); A reference to a `LineItem` object that has an allocated sourcedId (`GUID`).",
      "type" : "string"
    },
    "person" : {
      "description" : "The GUID of the person for whom the result is assigned, this will typically be a link to a person with a role of student.",
      "$comment" : "Origin: PersonGUIDRef (DerivedType); A reference to a `Person` object that has an allocated sourcedId (`GUID`).",
      "type" : "string"
    },
    "education" : {
      "description" : "A reference to an Edu-API education. This may be an offering or a template. Please refer to the educationType attribute to determine the type.",
      "$comment" : "Origin: EducationGUIDRef (DerivedType); A reference to an `Education` object that has an allocated sourcedId (`GUID`). This education might be a template or an offering, this will be indicated by the companion educationType attribute",
      "type" : "string"
    },
    "educationType" : {
      "description" : "Identifies the type of education entity referenced, allowing the consumer to determine the appropriate endpoint for retrieving the associated education details.",
      "$comment" : "Origin: EducationTypeEnum (EnumExt); Identifies the type of education entity referenced, allowing the consumer to determine the appropriate endpoint for retrieving the associated education details.",
      "oneOf" : [ {
        "type" : "string",
        "enum" : [ "collection", "course", "component", "collectionOffering", "courseOffering", "componentOffering" ]
      }, {
        "type" : "string",
        "pattern" : "(ext:)[a-z|A-Z|0-9|.|-|_]+"
      } ]
    },
    "scoreScale" : {
      "description" : "The GUID of the ScoreScale against which the result is aligned.",
      "$comment" : "Origin: ScoreScaleGUIDRef (DerivedType); A reference to a `ScoreScale` object that has an allocated sourcedId (`GUID`).",
      "type" : "string"
    },
    "scoreStatus" : {
      "description" : "The status of the score. The value is from an extensible enumerated vocabulary.",
      "$comment" : "Origin: ScoreStatusEnum (EnumExt); The vocabulary for the permitted set of tokens for the status of the score for a result.",
      "oneOf" : [ {
        "type" : "string",
        "enum" : [ "exempt", "fullyGraded", "notSubmitted", "partiallyGraded", "submitted", "withdrawal", "locked", "underReview" ]
      }, {
        "type" : "string",
        "pattern" : "(ext:)[a-z|A-Z|0-9|.|-|_]+"
      } ]
    },
    "score" : {
      "description" : "The score for the result. If a scoreScale is assigned then the value must align with the scale.",
      "$comment" : "Origin: Float (PrimitiveType)",
      "type" : "number"
    },
    "textScore" : {
      "description" : "An optional non-numeric score value. If a scoreScale is assigned then the value must align with the scale.",
      "$comment" : "Origin: NormalizedString (PrimitiveType); A `String` conforming to the `normalizedString` definition in [[XMLSCHEMA11-2]].",
      "type" : "string"
    },
    "scoreDate" : {
      "description" : "The date at which the score is assigned or there is an update to the result e.g. change in the 'scoreStatus'. The format is YYYY-MM-DD as defined in [ISO 8601].",
      "$comment" : "Origin: Date (PrimitiveType); An [[ISO8601]] calendar date using the syntax YYYY-MM-DD.",
      "type" : "string",
      "format" : "date"
    },
    "comment" : {
      "$ref" : "#/$defs/LanguageTypedString"
    },
    "learningObjectiveSet" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/$defs/LearningObjectiveScoreSet"
      }
    },
    "inProgress" : {
      "description" : "This is used to indicate that the associated work activity has been assigned and student's work product is not yet expected to have been submitted.",
      "$comment" : "Origin: Boolean (PrimitiveType); A boolean, expressed as `true` or `false`",
      "type" : "boolean"
    },
    "incomplete" : {
      "description" : "This is used to indicate that the student's work product has been submitted but it is deemed incomplete by the teacher.",
      "$comment" : "Origin: Boolean (PrimitiveType); A boolean, expressed as `true` or `false`",
      "type" : "boolean"
    },
    "late" : {
      "description" : "This is used to indicate that the student's work product is either past due or it has been submitted past the due date. The score on this result may be impacted as a result of this flag.",
      "$comment" : "Origin: Boolean (PrimitiveType); A boolean, expressed as `true` or `false`",
      "type" : "boolean"
    },
    "missing" : {
      "description" : "This is used to indicate that the student's work product has not been submitted.",
      "$comment" : "Origin: Boolean (PrimitiveType); A boolean, expressed as `true` or `false`",
      "type" : "boolean"
    },
    "parentResult" : {
      "description" : "An Edu-API reference to another Result. This allows for the building of result hierarchies.",
      "$comment" : "Origin: ResultGUIDRef (DerivedType); A reference to a `Result` object that has an allocated sourcedId (`GUID`).",
      "type" : "string"
    }
  },
  "required" : [ "sourcedId", "recordLanguage", "recordStatus", "lineItem", "person", "scoreStatus", "scoreDate" ],
  "additionalProperties" : false,
  "$defs" : {
    "resultExtensions" : {
      "description" : "Extension properties related to results",
      "type" : "object",
      "properties" : { },
      "required" : [ ],
      "additionalProperties" : true
    },
    "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
    },
    "LearningObjectiveScoreSet" : {
      "description" : "Represents the set of mastery scores for learning objectives, from a single source.",
      "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/learningObjectiveScoreSetExtensions"
        },
        "source" : {
          "description" : "The source responsible for creating the learning objective identifiers. The permitted values are from an extensible vocabulary.",
          "$comment" : "Origin: SourceExtEnum (EnumExt); The predefined vocabulary for the source that was responsible for creating the learning objective identifiers.",
          "oneOf" : [ {
            "type" : "string",
            "enum" : [ "case", "unknown", "CTDL-ASN" ]
          }, {
            "type" : "string",
            "pattern" : "(ext:)[a-z|A-Z|0-9|.|-|_]+"
          } ]
        },
        "learningObjectiveResults" : {
          "type" : "array",
          "minItems" : 1,
          "items" : {
            "$ref" : "#/$defs/LearningObjectiveResults"
          }
        }
      },
      "required" : [ "sourcedId", "recordLanguage", "recordStatus", "source", "learningObjectiveResults" ],
      "additionalProperties" : false
    },
    "LearningObjectiveResults" : {
      "description" : "Represents the mastery score for a learning objective.",
      "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/learningObjectiveResultsExtensions"
        },
        "learningObjectiveId" : {
          "description" : "The unique identifier for the associated learning objective. If this is a CASE identifier it MUST be a valid UUID.",
          "$comment" : "Origin: NormalizedString (PrimitiveType); A `String` conforming to the `normalizedString` definition in [[XMLSCHEMA11-2]].",
          "type" : "string"
        },
        "score" : {
          "description" : "The optional mastery score supplied as a numeric value.",
          "$comment" : "Origin: Float (PrimitiveType)",
          "type" : "number"
        },
        "textScore" : {
          "description" : "The optional mastery score supplied in a non-numeric form.",
          "$comment" : "Origin: NormalizedString (PrimitiveType); A `String` conforming to the `normalizedString` definition in [[XMLSCHEMA11-2]].",
          "type" : "string"
        }
      },
      "required" : [ "sourcedId", "recordLanguage", "recordStatus", "learningObjectiveId" ],
      "additionalProperties" : false
    },
    "learningObjectiveResultsExtensions" : {
      "description" : "Extension properties related to learning objective results",
      "type" : "object",
      "properties" : { },
      "required" : [ ],
      "additionalProperties" : true
    },
    "learningObjectiveScoreSetExtensions" : {
      "description" : "Extension properties related to learning objective score sets",
      "type" : "object",
      "properties" : { },
      "required" : [ ],
      "additionalProperties" : true
    }
  }
}