{
  "$schema" : "https://json-schema.org/draft/2019-09/schema#",
  "$id" : "https://purl.imsglobal.org/spec/orgradebook/v1p2/schema/json/orgradebook_v1p2_resultset-jsonschema1.json",
  "title" : "JSON Schema for the ResultSet class.",
  "description" : "This is the container for a collection of result instances for a message payload. This may be empty if no instances are found that sustain the applied query constraints. The order is not significant.",
  "type" : "object",
  "properties" : {
    "results" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/$defs/Result"
      }
    }
  },
  "required" : [ ],
  "additionalProperties" : false,
  "$defs" : {
    "Result" : {
      "description" : "This is the container for the Result record.  A result consists of the assigned score plus the context for that score.",
      "type" : "object",
      "properties" : {
        "lineItem" : {
          "$ref" : "#/$defs/LineItemGUIDRef"
        },
        "student" : {
          "$ref" : "#/$defs/UserGUIDRef"
        },
        "class" : {
          "$ref" : "#/$defs/ClassGUIDRef"
        },
        "scoreScale" : {
          "$ref" : "#/$defs/ScoreScaleGUIDRef"
        },
        "scoreStatus" : {
          "description" : "The status of the score. The value is from an extensible enumerated vocabulary.",
          "$comment" : "Origin: ScoreStatusExtEnum (Union); This is an extensible vocabulary data-type for the status of the score being submitted.",
          "oneOf" : [ {
            "type" : "string",
            "enum" : [ "exempt", "fully graded", "not submitted", "partially graded", "submitted" ]
          }, {
            "type" : "string",
            "pattern" : "(ext:)[a-zA-Z0-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. This attribute was added in OR 1.2.",
          "$comment" : "Origin: NormalizedString (PrimitiveType)",
          "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)",
          "type" : "string",
          "format" : "date"
        },
        "comment" : {
          "description" : "A human readable comment about the score.",
          "$comment" : "Origin: String (PrimitiveType)",
          "type" : "string"
        },
        "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: BooleanTrueFalseEnum (Enumeration); This enumeration is used to limit the permitted tokens for a Boolean data-type to values of 'true' or 'false' ONLY.",
          "type" : "string",
          "enum" : [ "true", "false" ]
        },
        "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: BooleanTrueFalseEnum (Enumeration); This enumeration is used to limit the permitted tokens for a Boolean data-type to values of 'true' or 'false' ONLY.",
          "type" : "string",
          "enum" : [ "true", "false" ]
        },
        "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 as result of this flag.",
          "$comment" : "Origin: BooleanTrueFalseEnum (Enumeration); This enumeration is used to limit the permitted tokens for a Boolean data-type to values of 'true' or 'false' ONLY.",
          "type" : "string",
          "enum" : [ "true", "false" ]
        },
        "missing" : {
          "description" : "This is used to indicate that the student's work product as not been submitted.",
          "$comment" : "Origin: BooleanTrueFalseEnum (Enumeration); This enumeration is used to limit the permitted tokens for a Boolean data-type to values of 'true' or 'false' ONLY.",
          "type" : "string",
          "enum" : [ "true", "false" ]
        },
        "sourcedId" : {
          "description" : "The sourcedId of the object. All objects MUST be identified by a Source Identifier. This is a GUID System ID for an object. This is the GUID that SYSTEMS will refer to when making API calls, or when needing to identify an object. It is RECOMMENDED that systems are able to map whichever local ids (e.g. database key fields) they use to SourcedId. The sourcedId of an object is considered an addressable property of an entity and as such will not be treated as Personally Identifiable Information (PII) by certified products. Therefore, as a part of certification, vendors will be required to declare that they will notify customers via documentation or other formal and documented agreement that sourcedIds should never contain PII in general, but particularly users. This means that if a customer includes a student name in an enrollment.sourcedId, it will not fall to any certified product to protect the enrollment.sourcedId as PII, or even the userSourcedId field in the enrollment record.",
          "$comment" : "Origin: GUID (DerivedType); The data-type for establishing a Globally Unique Identifier (GUID). There is no predefined structure for the GUID.",
          "type" : "string"
        },
        "status" : {
          "description" : "All objects MUST BE either 'active' or 'tobedeleted'. Something which is flagged 'tobedeleted' is to be considered safe to delete. Systems can delete records that are flagged as such if they wish, but they are not under any compulsion to do so. In v1.1 the enumeration value of 'inactive' was removed and so for backwards compatibility all such marked objects should be interpreted as 'tobedeleted'.",
          "$comment" : "Origin: BaseStatusEnum (Enumeration); The set of permitted values for the type of status of a record. ",
          "type" : "string",
          "enum" : [ "active", "tobedeleted" ]
        },
        "dateLastModified" : {
          "description" : "All objects MUST be annotated with the dateTime upon which they were last modified. This enables requesters to query for just the latest objects. DateTimes MUST be expressed in W3C profile of [ISO 8601] and MUST contain the UTC timezone.",
          "$comment" : "Origin: DateTime (PrimitiveType)",
          "type" : "string",
          "format" : "date-time"
        },
        "metadata" : {
          "$ref" : "#/$defs/Metadata"
        }
      },
      "required" : [ "lineItem", "student", "scoreStatus", "scoreDate", "sourcedId", "status", "dateLastModified" ],
      "additionalProperties" : false
    },
    "UserGUIDRef" : {
      "description" : "This is the container for reference to a OneRoster 'User' object that has an allocated sourcedId (GUID).",
      "type" : "object",
      "properties" : {
        "type" : {
          "description" : "The type of object being referenced i.e. a 'user'.",
          "$comment" : "Origin: UserGUIDRefTypeEnum (Enumeration); This is the fixed enumeration for a GUIDRef that points to an 'User'. ",
          "type" : "string",
          "enum" : [ "user" ]
        },
        "href" : {
          "description" : "The URI for the type of object being referenced.",
          "$comment" : "Origin: AnyURI (PrimitiveType)",
          "type" : "string"
        },
        "sourcedId" : {
          "description" : "The globally unique identifier of the object being referenced.",
          "$comment" : "Origin: GUID (DerivedType); The data-type for establishing a Globally Unique Identifier (GUID). There is no predefined structure for the GUID.",
          "type" : "string"
        }
      },
      "required" : [ "type", "href", "sourcedId" ],
      "additionalProperties" : false
    },
    "ScoreScaleGUIDRef" : {
      "description" : "This is the container for reference to a OneRoster 'ScoreScale' object that has an allocated sourcedId (GUID).",
      "type" : "object",
      "properties" : {
        "type" : {
          "description" : "The type of object being referenced i.e. a 'scoreScale'.",
          "$comment" : "Origin: ScoreScaleGUIDRefTypeEnum (Enumeration); This is the fixed enumeration for a GUIDRef that points to an 'ScoreScale'. ",
          "type" : "string",
          "enum" : [ "scoreScale" ]
        },
        "href" : {
          "description" : "The URI for the type of object being referenced.",
          "$comment" : "Origin: AnyURI (PrimitiveType)",
          "type" : "string"
        },
        "sourcedId" : {
          "description" : "The globally unique identifier of the object being referenced.",
          "$comment" : "Origin: GUID (DerivedType); The data-type for establishing a Globally Unique Identifier (GUID). There is no predefined structure for the GUID.",
          "type" : "string"
        }
      },
      "required" : [ "type", "href", "sourcedId" ],
      "additionalProperties" : false
    },
    "ClassGUIDRef" : {
      "description" : "This is the container for reference to a OneRoster 'Class' object that has an allocated sourcedId (GUID).",
      "type" : "object",
      "properties" : {
        "type" : {
          "description" : "The type of object being referenced i.e. a 'class'.",
          "$comment" : "Origin: ClassGUIDRefTypeEnum (Enumeration); This is the fixed enumeration for a GUIDRef that points to an 'Class'. ",
          "type" : "string",
          "enum" : [ "class" ]
        },
        "href" : {
          "description" : "The URI for the type of object being referenced.",
          "$comment" : "Origin: AnyURI (PrimitiveType)",
          "type" : "string"
        },
        "sourcedId" : {
          "description" : "The globally unique identifier of the object being referenced.",
          "$comment" : "Origin: GUID (DerivedType); The data-type for establishing a Globally Unique Identifier (GUID). There is no predefined structure for the GUID.",
          "type" : "string"
        }
      },
      "required" : [ "type", "href", "sourcedId" ],
      "additionalProperties" : false
    },
    "LearningObjectiveScoreSet" : {
      "description" : "This is the container for the set of learning objective identifiers that are from a single source responsible for creating those identifiers. This also allows a mastery score to be aligned with a learning objective.",
      "type" : "object",
      "properties" : {
        "source" : {
          "description" : "The source responsible for creating the learning objective identifiers. The permitted values are from an extensible vocabulary.",
          "$comment" : "Origin: SourceExtEnum (Union); This is an extensible vocabulary data-type for the source creating the learning objective identifiers.",
          "oneOf" : [ {
            "type" : "string",
            "enum" : [ "case", "unknown" ]
          }, {
            "type" : "string",
            "pattern" : "^(?!case$)(?!unknown$)[a-zA-Z0-9\\.\\-_]+$"
          } ]
        },
        "learningObjectiveResults" : {
          "type" : "array",
          "minItems" : 1,
          "items" : {
            "$ref" : "#/$defs/LearningObjectiveResults"
          }
        }
      },
      "required" : [ "source", "learningObjectiveResults" ],
      "additionalProperties" : false
    },
    "LearningObjectiveResults" : {
      "description" : "This is the container for a learning objective identifier. This also allows a mastery score to be aligned with the learning objective.",
      "type" : "object",
      "properties" : {
        "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)",
          "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)",
          "type" : "string"
        }
      },
      "required" : [ "learningObjectiveId" ],
      "additionalProperties" : false
    },
    "LineItemGUIDRef" : {
      "description" : "This is the container for reference to a OneRoster 'LineItem' object that has an allocated sourcedId (GUID).",
      "type" : "object",
      "properties" : {
        "type" : {
          "description" : "The type of object being referenced i.e. a 'lineItem'.",
          "$comment" : "Origin: LineItemGUIDRefTypeEnum (Enumeration); This is the fixed enumeration for a GUIDRef that points to an 'LineItem'. ",
          "type" : "string",
          "enum" : [ "lineItem" ]
        },
        "href" : {
          "description" : "The URI for the type of object being referenced.",
          "$comment" : "Origin: AnyURI (PrimitiveType)",
          "type" : "string"
        },
        "sourcedId" : {
          "description" : "The globally unique identifier of the object being referenced.",
          "$comment" : "Origin: GUID (DerivedType); The data-type for establishing a Globally Unique Identifier (GUID). There is no predefined structure for the GUID.",
          "type" : "string"
        }
      },
      "required" : [ "type", "href", "sourcedId" ],
      "additionalProperties" : false
    },
    "Metadata" : {
      "description" : "The container for the proprietary extensions.",
      "type" : "object",
      "properties" : { },
      "required" : [ ],
      "additionalProperties" : true
    }
  }
}