Skip to content
This repository has been archived by the owner on Jan 17, 2019. It is now read-only.

Latest commit

 

History

History
330 lines (224 loc) · 27.2 KB

24_statement_properties.md

File metadata and controls

330 lines (224 loc) · 27.2 KB

2.4. Statement Properties {#2-4-statement-properties}

Requirements

ID Requirement
XAPI-00021 All Statement properties must be used at most one time. An LRS rejects with 400 Bad Request a statement that contains a JSON object with a duplicate key.
XAPI-00022 A "timestamp" property is a TimeStamp, per section 4.5. An LRS rejects with 400 Bad Request a statement if it has a TimeStamp and that TimeStamp is invalid.
XAPI-00023 A "stored" property is a TimeStamp, per section 4.5. An LRS assigns the “stored” property upon receipt with a valid TimeStamp.
XAPI-00024 An "authority" property is an Agent or Group. An LRS rejects with 400 Bad Request a statement which has an “authority” property which is not Agent or Group.
XAPI-00025 A Statement's "attachments" property is an array of Attachments. An LRS rejects with 400 Bad Request a statement which has an “attachments” property which is not an array of attachments.

2.4.1. ID {#2-4-1-id}

Requirements

ID Requirement
XAPI-00026 An LRS generates the "id" property of a Statement if none is provided (Modify, 4.1.1.a)
XAPI-00027 A Statement's "id" property is a UUID following RFC 4122. An LRS rejects with 400 Bad Request a statement which has an “id” and that “id” is invalid.
XAPI-00028 A Statement's "id" property is a String. An LRS rejects with 400 Bad Request a statement which has an “id” and that property is not a string
XAPI-00029 All UUID types are in standard String form. An LRS rejects with 400 Bad Request a statement which has an property which is required to be a UUID and that property is not in standard string form
XAPI-00030 All UUID types follow requirements of RFC4122. An LRS rejects with 400 Bad Request a statement which has a property which is required to be a UUID and does not follow RFC4122.

{#-0}

{#-1}

2.4.2. Actor {#2-4-2-actor}

Requirements

ID Requirement
XAPI-00031 An "actor" property's "objectType" property is either "Agent" or "Group" An LRS rejects with 400 Bad Request an actor with an “objectType” which is not “Agent” or “Group”

2.4.2.1 When the Actor objectType is Agent {#2-4-2-1-when-the-actor-objecttype-is-agent}

Definition

  1. An Agent is defined as an Actor with "objectType" of an "Agent", an instructor with "objectType" of an "Agent", or "object" property with value "Agent"

Requirements

ID Requirement
XAPI-00032 An "objectType" property is a String. If present, the LRS must validate and reject with 400 Bad Request if invalid
XAPI-00033 A "name" property is a String. If present, the LRS must validate and reject with 400 Bad Request if invalid.
XAPI-00034 An "actor" property with "objectType" as "Agent" uses exactly one of the following Inverse Functional Identifier properties: "mbox", "mbox_sha1sum", "openid", "account". An LRS rejects with 400 Bad Request any agent object:

{#-14}

{#-15}

{#-16}

2.4.2.2 When the Actor ObjectType is Group {#2-4-2-2-when-the-actor-objecttype-is-group}

Definition

  1. An anonymous Group is defined when at least one of the following is true:
    • An “actor” property with “objectType” of “group” with the “member” property present, but without an IFI
    • A “context” object with a “team” property of “group” with the “member” property present
    • An “object” with the value “Group” with the “member” property present.
  2. An identified Group is defined when at least one of the following is true:
    • An “actor” property with “objectType” of “group” and an IFI present
    • A “context” object with a “team” property of “group” and an IFI is present
    • An “object” with the value “Group” and an IFI present

Requirements

ID Requirement
XAPI-00035 A Group uses the "member" property. An LRS rejects with 400 Bad Request if the “member” property is present anywhere but in a group object (Actor or team).
XAPI-00036 The "member" property is an array of Objects following Agent requirements. An LRS rejects with 400 Bad Request any group object which has a member property with anything other than a valid array of Agents as a value
XAPI-00037 An "actor" property with "objectType" as "Group" uses exactly one of the following Inverse Functional Identifier properties: "mbox", "mbox_sha1sum", "openid", "account" or a member property with at least one Agent. An LRS rejects with 400 Bad Request any group object with:

{#-17}

2.4.2.3 Inverse Functional Identifier {#2-4-2-3-inverse-functional-identifier}

Definition

An Inverse Functional Identifier (IFI) is a value of an Agent or Identified Group that is guaranteed to only ever refer to that Agent or Identified Group.

Requirements

ID Requirement
XAPI-00038 An "mbox" property has the form "mailto:email address" and is an IRI. An LRS rejects with 400 Bad Request if a statement that uses the “mbox” IFI is an invalid form.
XAPI-00039 An "mbox_sha1sum" property is a String An LRS rejects with 400 Bad Request if a statement uses the “mbox_sha1sum” IFI and it is not a valid string.
XAPI-00040 An "openid" property is a URI. An LRS rejects with 400 Bad Request if a statement uses the “openID” IFI and the URI is invalid.
XAPI-00041 An “account” property is an object. An LRS rejects with 400 Bad Request if a statement uses an invalid Account Object. A valid account is defined by the requirements listed in XAPI-I-63 and XAPI-I-66

{#-18}

2.4.2.4 Account Object {#2-4-2-4-account-object}

Definition

  1. An Account Object is the "account" property of a Group or Agent

Requirements

ID Requirement
XAPI-00042 An Account Object's homePage" property is an IRL. An LRS rejects with 400 Bad Request if a statement uses the “account” IFI and the “homePage” property is absent or has an invalid IRL.
XAPI-00043 An Account Object "name" property is a String. An LRS rejects with 400 Bad Request if a statement uses the “account” IFI and the “name” property is absent or has an invalid string.

{#-2}

2.4.3. Verb {#2-4-3-verb}

Requirements

ID Requirement
XAPI-00044 A "verb" object contains an "id" property which is required to be an IRI. An LRS rejects with 400 Bad Request if a statement uses the Verb Object and “id” is absent or “id” is present, but the value is an invalid IRI.
XAPI-00045 A "verb" property's "display" property is a Language Map. An LRS rejects with 400 Bad Request if a statement uses the Verb Object’s “display” property and it is not a valid Language Map.

{#-3}

{#-4}

{#-5}

2.4.4. Object {#2-4-4-object}

Requirements

ID Requirement
XAPI-00046 An "object" property's "objectType" property is either "Activity", "Agent", "Group", "SubStatement", or "StatementRef". An LRS rejects with 400 Bad Request an “object” property with an objectType which is not "Activity", "Agent", "Group", "SubStatement", or "StatementRef".

{#-19}

2.4.4.1 When the ObjectType is Activity {#2-4-4-1-when-the-objecttype-is-activity}

Definition

  1. An Activity is defined by an "object" without "objectType" or with "objectType" having the value "Activity"
  2. An Activity Definition is defined as the contents of a "definition" property object of an Activity

Requirements

ID Requirement
XAPI-00047 An "object" property uses the "id" property exactly one time. The LRS must reject with 404 Bad Request an otherwise legal statement if the object's objectType is Activity and the object's “id” is not an IRI or the object’s “id” is absent
XAPI-00048 An "object" property uses the "definition" property at most one time. The LRS rejects with 400 Bad Request an otherwise legal statement if the object's “definition” property is an invalid object.
XAPI-00049 An Activity Definition's "interactionType" property is a String with a value of either true-false, choice, fill-in, long-fill-in, matching, performance, sequencing, likert, numeric or other. An LRS rejects with 400 Bad Request an Activity Definition's "interactionType" property if it is not a string value of true-false, choice, fill-in, long-fill-in, matching, performance, sequencing, likert, numeric or other.
XAPI-00050 An Activity Definition's "correctResponsesPattern" property is an array of Strings. An LRS rejects with 400 Bad Request an Activity Definition's "correctResponsesPattern" property if present, and if it is not a valid array of strings.
XAPI-00051 An Activity Definition's "steps" property is an array of Interaction Components. An LRS rejects with 400 Bad Request if an Activity Definition's "steps" property if present, and is not a valid array of Interaction Components.
XAPI-00052 An Activity Definition's "target" property is an array of Interaction Components. An LRS rejects with 400 Bad Request if an Activity Definition's "target" property if present, and is not a valid array of Interaction Components.
XAPI-00053 An Activity Definition's "source" property is an array of Interaction Components. An LRS rejects with 400 Bad Request if an Activity Definition's "source" property if present, and is not a valid array of Interaction Components.
XAPI-00054 An Activity Definition's "scale" property is an array of Interaction Components, An LRS rejects with 400 Bad Request if an Activity Definition's "scale" property if present, and is not a valid array of Interaction Components.
XAPI-00055 An Activity Definition's "choices" property is an array of Interaction Components. An LRS rejects with 400 Bad Request if an Activity Definition's "choices" property if present, and is not a valid array of Interaction Components.
XAPI-00056 An Activity Definition's "name" property is a Language Map. The LRS rejects with 400 Bad Request an otherwise legal statement if the Activity Definition's "name" property is present and is an invalid Language Map.
XAPI-00057 An Activity Definition's "extension" property is an Object. The LRS rejects with 400 Bad Request an otherwise legal statement if the Activity Definition's "extension" property is present and is an invalid Extension Object.
XAPI-00058 Within an array of Interaction Components, the "id" property is a string which is required and unique (within the specific interaction array). The LRS rejects with 400 Bad Request an interaction activity with an array of interaction components in which the “id” property is absent, duplicative, or an invalid string.
XAPI-00059 An Activity Definition's "description" property is a Language Map. The LRS rejects with 400 Bad Request an otherwise legal statement if the Activity Definition's "description" property is present and is an invalid Language Map.
XAPI-00060 An Activity Definition's "type" property is an IRI. The LRS rejects with 400 Bad Request an otherwise legal statement if the Activity Definition's "type" property is present and is an invalid IRI.
XAPI-00061 An Activity Definition's "moreinfo" property is an IRL. The LRS rejects with 400 Bad Request an otherwise legal statement if the Activity Definition's "moreinfo" property is present and is an invalid IRL.
XAPI-00062 An Interaction Component’s "description" property is a Language Map. The LRS rejects with 400 Bad Request an otherwise legal statement if the Interaction Component's "description" property is present and is an invalid Language Map.
XAPI-00063 An individual Interaction Component, within the array of Interaction Components, is an Object. The LRS rejects with 400 Bad Request an otherwise legal statement if the Interaction Component is present and is an invalid Object.
XAPI-00064 An Activity Definition uses the "interactionType" property if correctResponsesPattern is present. An LRS rejects a statement with 400 Bad Request if a correctResponsePattern is present and interactionType is not.

{#-20}

{#-21}

{#-22}

2.4.4.2 When the "Object" is an Agent or a Group {#2-4-4-2-when-the-object-is-an-agent-or-a-group}

Requirements

ID Requirement
XAPI-00065 Statements that use an Agent or Group as an Object MUST specify an "objectType" property. The LRS rejects with 400 Bad Request if the “objectType” property is absent and the Object is an Agent Object or Group Object.

{#-23}

{#-24}

{#-25}

2.4.4.3 When the "Object" is a Statement {#2-4-4-3-when-the-object-is-a-statement}

Definition

  1. A Statement Reference is defined by the "objectType" of an "object" with value "StatementRef"
  2. A Sub-Statement is defined by the "objectType" of an "object" with value "SubStatement"

Requirements

ID Requirement
XAPI-00066 A Sub-Statement follows the requirements of all Statements. The LRS rejects with 400 Bad Request a Statement with a Sub-Statement with any invalid statement properties in an otherwise valid sub-statement.
XAPI-00067 A Sub-Statement cannot use the "authority" property. The LRS rejects with 400 Bad Request a Statement with a Sub-Statement where the “authority” property is present.
XAPI-00068 A Sub-Statement cannot use the "version" property. The LRS rejects with 400 Bad Request a Statement with a Sub-Statement where the “version” property is present.
XAPI-00069 A Sub-Statement cannot use the "stored" property. The LRS rejects with 400 Bad Request a Statement with a Sub-Statement where the “stored” property is present.
XAPI-00070 A Sub-Statement cannot use the "id" property at the Statement level The LRS rejects with 400 Bad Request a Statement with a Sub-Statement where the “id” property is present.
XAPI-00071 A Sub-Statement cannot have a Sub-Statement. The LRS rejects with 400 Bad Request a Statement with a Sub-Statement which contains a Sub-Statement.
XAPI-00072 A Statement Reference's "id" property is a UUID. The LRS rejects with 400 Bad Request a Statement Reference Object with an “id” property which is absent or an invalid UUID.
XAPI-00073 Statements that have a StatementRef or Sub-Statement as an Object MUST specify an "objectType" property. The LRS rejects with 400 Bad Request if the “objectType” property is absent and the Object is a StatementRef or Sub-Statement.

{#-6}

2.4.5. Result {#2-4-5-result}

Requirements

ID Requirement
XAPI-00074 A "success" property is a Boolean. The LRS rejects with 400 Bad Request a Statement which has a Result Object with a “success” property which does not have a valid Boolean value, if present.
XAPI-00075 A "completion" property is a Boolean. The LRS rejects with 400 Bad Request a Statement which has a Result Object with a “completion” property which does not have a valid Boolean value, if present.
XAPI-00076 A "response" property is a String. The LRS rejects with 400 Bad Request a Statement which has a Result Object with a “response” property which does not have a valid String value, if present.
XAPI-00077 A "duration" property is a formatted to ISO 8601 durations (see part 3, section 4.6). The LRS rejects with 400 Bad Request a Statement which has a Result Object with a “duration” property which does not have a valid ISO 8601 value, if present.
XAPI-00078 An "extensions" property is an Object. The LRS rejects with 400 Bad Request a Statement which has a Result Object with aa “extensions” property which does not have a valid Extensions Object, if present.

{#-26}

2.4.5.1 Score {#2-4-5-1-score}

Requirements

ID Requirement
XAPI-00079 A "score" property is an Object. The LRS rejects with 400 Bad Request a “score” property which is not a valid object.
XAPI-00080 If the "score" Object uses the "max" property, the value must be a decimal number more than the "min" property, if it is present. If "min" is not present "max" can be any number. The LRS rejects with 400 Bad Request a statement with a Result Object using the “max” property (if it is present) which is not a decimal number or is lesser than the value of the “min” property, if it is present.
XAPI-00081 If the "score" Object uses the "min" property, the value must be a decimal number less than the "max" property, if it is present. If "max" is not present "min" can be any number. The LRS rejects with 400 Bad Request a statement with a Result Object using the “min” property (if it is present) which is not a decimal number or is greater than the value of the “max” property, if it is present.
XAPI-00082 If the "score" Object uses the "raw" property, the value must be a decimal number between the "min" and "max", if they are present. If they are not present "raw" can be any number. The LRS rejects with 400 Bad Request a statement with a Result Object using the “raw” property (if it is present) which is not a decimal number or is greater than the value of the “max” property, if it is present, or lesser than the value of the “min” property, if it is present.
XAPI-00083 If the "score" Object uses the "scaled" property, the value must be a decimal number between -1 and 1. The LRS rejects with 400 Bad Request a statement with a Result Object using the “scaled” property (if it is present) which is not a decimal number or is greater than 1 or less than -1.

{#-7}

{#-8}

{#-9}

2.4.6. Context {#2-4-6-context}

Requirements

ID Requirement
XAPI-00084 A Statement cannot contain both a "revision" property in its "context" property and have the value of the "object" property's "objectType" be anything but "Activity". The LRS rejects a statement with 400 Bad Request if contains a "revision" property in its "context" property and does not have an Object with an “objectType” value of “activity” or an Object where the “objectType” property is absent.
XAPI-00085 A Statement cannot contain a "platform" property in its "context" property and have the value of the "object" property's "objectType" be anything but "Activity". The LRS rejects a statement with 400 Bad Request if contains a "platform" property in its "context" property and does not have an Object with an “objectType” value of “activity” or an Object where the “objectType” property is absent.
XAPI-00086 A "contextActivities" property is an Object. The LRS rejects with 400 Bad Request a statement with a “contextActivities” property which is not a valid object.
XAPI-00087 A "registration" property is a UUID. The LRS rejects with 400 Bad Request a statement with a “registration” property which is not a valid UUID.
XAPI-00087 An "instructor" property is an Agent. The LRS rejects with 400 Bad Request a statement with an “instructor” property which is not a valid Agent.
XAPI-00088 An "team" property is a Group. The LRS rejects with 400 Bad Request a statement with a “team” property which is not a valid Group.
XAPI-00089 A "revision" property is a String. The LRS rejects with 400 Bad Request a statement with a “revision” property which is not a valid string.
XAPI-00090 A "platform" property is a String. The LRS rejects with 400 Bad Request a statement with a “platform” property which is not a valid string.
XAPI-00091 A "language" property is a String which follows RFC 5646. The LRS rejects with 400 Bad Request a statement with a “language” property which is not a valid RFC 5646 string.
XAPI-00092 A "statement" property is a Statement Reference. The LRS rejects with 400 Bad Request a statement with a “statement” property which is not a valid StatementRef.

{#-27}

{#-28}

{#-29}

2.4.6.2 ContextActivities Property {#2-4-6-2-contextactivities-property}

Definition

  1. A ContextActivity is defined as a single Activity of the "value" of the "contextActivities" property

Requirements

ID Requirement
XAPI-00093 A "contextActivities" property's "key" has a value of "parent", "grouping", "category", or "other". The LRS rejects with 400 Bad Request a statement which has a key other than "parent", "grouping", "category", or "other" for the “contextActivities” property
XAPI-00094 A "contextActivities" property's "value" is an Activity. The LRS rejects with 400 Bad Request a statement which has a value which is not an Activity for the “contextActivities” property.
XAPI-00095 A "contextActivities" property contains one or more key/value pairs. The LRS rejects with 400 Bad Request a statement which has an empty “contextActivities” property.
XAPI-00096 An LRS's Statement Resource returns a ContextActivity in an array, even if only a single ContextActivity is returned.

{#-10}

2.4.8. Stored {#2-4-8-stored}

Requirements

ID Requirement
XAPI-00097 An LRS MUST assign the "stored" property timestamp upon receiving a statement.

{#-11}

2.4.9. Authority {#2-4-9-authority}

Requirements

ID Requirement
XAPI-00098 An "authority" property which is also a Group contains exactly two Agents. The LRS rejects with 400 Bad Request a statement which has an “authority” property with a “objectType” of “Group” with more or less than two Oauth Agents as values of the “member” property.
XAPI-00099 An LRS populates the "authority" property if it is not provided in the Statement
XAPI-00100 An LRS rejects with error code 400 Bad Request, a Request whose "authority" is a Group having more than two Agents

{#-12}

2.4.10. Version {#2-4-10-version}

Requirements

ID Requirement
XAPI-00101 An LRS rejects with error code 400 Bad Request, a Request which uses "version" and has the value set to anything but "1.0" or "1.0.x", where x is the semantic versioning number

{#-13}

2.4.11. Attachments {#2-4-11-attachments}

Definition

  1. An Attachment is an Object

Requirements

ID Requirement
XAPI-00102 A "length" property is an Integer. The LRS rejects with 400 Bad Request a statement which does not have a “length” property or the “length” property is not a valid integer in octets in the Attachment Object.
XAPI-00103 A "sha2" property is a String. The LRS rejects with 400 Bad Request a statement which does not have a “sha2” property or the ”sha2” property is not a valid hash in the Attachment Object.
XAPI-00104 A "fileUrl" property is an IRL. The LRS rejects with 400 Bad Request a statement the “fileURL” property if it is present and it is not a valid IRL in the Attachment Object.
XAPI-00105 A "contentType" property is an Internet Media/MIME type. The LRS rejects with 400 Bad Request a statement which does not have a “contentType” property or the “contentType” property value is not Internet Media/MIME in the Attachment Object.
XAPI-00106 A "display" property is a Language Map. The LRS rejects with 400 Bad Request a statement which does not have a “display” property or the “display” property value is not a valid Language Map in the Attachment Object.
XAPI-00107 A "usageType" property is an IRI. The LRS rejects with 400 Bad Request a statement which does not have a "usageType" property or the "usageType" property value is not a valid IRI in the Attachment Object.