< Previous | Contents | Next >
4.3.2. Data Store Access and Persistence
A SCO can invoke GetValue() on adl.data._count to determine how many (if any) data stores have been identified for use by the SCO. The LMS is responsible for managing this list as a zero-based indexed list. When a SCO requests the adl.data._count, the LMS shall return the total number of data stores currently being managed by the LMS for the SCO; the number of data stores should match identically to the number of data stores defined in the SCO’s associated activity’s <adlcp:data> element.
The data store IDs are signifigant across all activities within an activity tree. Two or more SCOs may be given access the the same data store via a <adlcp:data> element (for details see the SCORM CAM). The number of data stores the data stored within a data store does not have a required format or syntax; it is the SCOs’ responsibility to process and interpret the data as necessary.
The adlcp:sharedDataGlobalToSystem attribute (see Section 3.4.1.7 in the SCORM CAM) defines the scope of persistence for the shared data stores. By default, the LMS shall maintain the contents of all data stores related to the activity tree across learner attempts. If adlcp:sharedDataGlobalToSystem is false, then the LMS shall reset the data stores upon beginning a new leanrner attempt on the activity tree.
Table 4.3.2a summarizes high level information about each each of the adl.data data model elements.
Table 4.3.2a: Dot-notation Binding for the ADL Data Extension Elements
Dot-Notation Binding | Details |
adl.data._children | The adl.data._children data model element represents a listing of supported data model subelements. This data model element is typically used by a SCO to determine which data model elements are supported by the LMS. The characterstring returned may be used by the SCO to dynamically build parameters for the GetValue() and SetValue() requests. Data Model Element Implementation Requirements: Data Type: characterstring Value Space: ISO-10646-1 [5] Format: A comma-separated list of all of the data model elements in the Data parent data model element that are supported by the LMS. Since all data model elements are required to be supported by the LMS, the characterstring shall represent the following data model elements: o id o store LMS Behavior Requirements: This data model element is mandatory and shall be implemented by an LMS as read-only. The LMS is responsible for returning a comma-separated list of all of the data model elements (refer to Data Model Element Implementation Requirements above). SCO Behavior Requirements: This data model element is required to be implemented by an LMS as read- only. The SCO is only permitted to retrieve the value of the adl.data._children data model element. API Implementation Requirements: GetValue(): The LMS shall return a comma-separated list of data model elements supported by the LMS (refer to Data Model Element Implementation Requirements above) and set the error code to 0 – No Error. The ordering of data model elements is not important. The characterstring returned shall adhere to the requirements identified in the Data Model Element Implementation Requirements. SetValue(): If the SCO invokes a SetValue() request to set the adl.data._children, the LMS shall set the error code to 404 – Data Model Element Is Read Only and return “false”. Example: GetValue(“adl.data._children”) |
adl.data._count | The adl.data._count keyword is used to describe the current number of data stores being managed by the LMS. The total number of entries currently being stored by the LMS shall be returned. Data Model Element Implementation Requirements: Data Type: integer Value Space: Non-negative integer Format: The characterstring representing the number of data that the LMS is currently persisting. LMS Behavior Requirements: This data model element is mandatory and shall be implemented by the LMS as read-only. If the LMS receives a request to get the adl.data._count value prior to any interaction data being set, then the LMS shall adhere to the requirements listed below for API Implementation Requirements. SCO Behavior Requirements: The data model element is required to be implemented by an LMS as read- |
Dot-Notation Binding | Details |
only. The SCO is only permitted to retrieve the value of the adl.data._count data model element. API Implementation Requirements: GetValue(): The LMS shall return the number of data currently stored by the LMS and set the error code to 0 – No Error. o Until data data is available for the SCO, the LMS shall return 0, which indicates that there are no data data currently being stored. SetValue(): If the SCO invokes a SetValue() request to set the adl.data._count, then the LMS shall set the error code to 404 – Data Model Element Is Read Only and return “false”. Example: GetValue(“adl.data._count”) | |
adl.data.n.id | The adl.data.n.id data model element is a label for the data. This label shall be unique at least within the scope of the SCO per data record.[1]. Data Model Element Implementation Requirements: Data Type: long_identifier_type Value Space: A characterstring (SPM: 4000) that represents a valid URI as per RFC 3986 [6]. It is recommended that the URI be a URN as per RFC 2141 [3]. Format: Refer to Section 4.1.1.7: Data Types for more information on the requirements for the format of the long_identifier_type data type. LMS Behavior Requirements: This data model element is mandatory and shall be implemented by an LMS as read-only. The LMS is responsible for initializing this data model element using the ADL Content Packaging attribute adlcp:targetID of the namespace element <adlcp:map>. This element, if needed, shall only be placed on an <imscp:item> element that references a SCO resource, found in a Content Package Manifest. SCO Behavior Requirements: The data model element is required to be implemented by an LMS as read- only. The SCO is only permitted to retrieve the value of the adl.data.n.id data model element. API Implementation Requirements: GetValue(): The LMS shall return the associated adl.data.n.id currently stored by the LMS for the learner and set the error code to 0 – No Error. The characterstring returned shall adhere to the requirements identified in the Data Model Element Implementation Requirements. o The data model binding for collections is represented as packed arrays. If the SCO invokes a GetValue() request where the index (n) is a number larger than what the LMS is currently maintaining (e.g., the request indicated an n value of 5 when there are only 3 data in the array), then the LMS shall set the error code to 301 – General Get Failure and return an empty characterstring (“”). Refer to Section 3.1.7.6: SCORM Extension Error Conditions for further recommendations on processing this request. SetValue(): If the SCO invokes a SetValue() request to set the adl.data.n.id, then the LMS shall set the error code to 404 – Data Model Element Is Read Only and return “false”. Example: GetValue(“adl.data.0.id”) |
adl.data.n.store | Data Model Element Implementation Requirements: Data Type: characterstring (SPM: 64000) Value Space: ISO-10646-1 |
Dot-Notation Binding | Details |
Format: The format of this characterstring is left to the discretion of the SCO developer. The LMS simply stores the data, if requested to by the SCO ( SetValue() ) and returns the data, if requested to by the SCO ( GetValue() ). Refer to Section 4.1.1.7: Data Types for more information on the requirements for the format of the characterstring data type. LMS Behavior Requirements: The data model element is mandatory and shall be implemented by the LMS as read/write. The LMS is not responsible for the initialization of this data. The LMS is only responsible for storage and retrieval of the data for the SCO. If the SCO requests the value before the adl.data.n.store has been set, then the LMS shall behave according to the API Implementation Requirement behaviors defined below. SCO Behavior Requirements: The data model element is required to be implemented by the LMS as read/write. The SCO is permitted to retrieve and store the value of the adl.data.n.store data model element. API Implementation Requirements: GetValue(): The LMS shall return the associated adl.data.n.store and set the error code to 0 - No Error. The characterstring returned shall adhere to the requirements identified in the Data Model Element Implementation Requirements. o The data model binding for collections is represented as packed arrays. If the SCO invokes a GetValue() request where the index (n) is a number larger than what the LMS is currently maintaining (e.g., the request indicated an n value of 5 when there are only 3 objectives in the array), then the LMS shall set the error code to 301 – General Get Failure and return an empty characterstring (“”). Refer to Section 3.1.7.6: SCORM Extension Error Conditions for further recommendations on processing this request. o If the data store has not been set prior to the get request, then the LMS shall set the error code to 403 - Data Model Element Value Not Initialized and return an empty characterstring (“”). o If the data store has not been set prior to the get request, then the LMS shall set the error code to 403 - Data Model Element Value Not Initialized and return an empty characterstring (“”). o It is possible that a “read” map has not been defined for the data store. In this case, the LMS shall set the error code to 405 – Data Model Element is Write Only and return an empty characterstring(“”). SetValue(): The LMS shall set the adl.data.n.store to the data supplied, set the error code to 0 - No Error and return “true”. The value must be a valid characterstring as defined by the Data Model Element Implementation Requirements. o If the supplied value of the SetValue() does not meet the requirements of the Data Model Element Implementation Requirements, then the LMS shall set the error code to 406 – Data Model Element Type Mismatch and return “false”. The LMS shall not alter the state of the data model element based on the request. o The data model binding for collections is represented as packed arrays. If the SCO invokes a SetValue() request where the index (n) provided is a number that is greater than the current number of objectives being stored, then the LMS shall set the error code to 351 – General Set Failure and return “false”. Refer to Section 3.1.7.6: SCORM Extension Error Conditions. o Since the adl.data.n.id is required to be set first prior to any other objective information, if the SCO attempts to set adl.data.n.store(prior to setting the identifier) then the LMS shall set the error code to 408 – Data Model Dependency Not Established |
Dot-Notation Binding | Details |
and return “false”. The LMS shall not alter the state of the data model element based on the request. o It is possible that a “write” map has not been defined for the data store. In this case, the LMS shall set the error code to 404 – Data Model Element is Read Only and return “false”. Additional Behavior Requirements: The SCO is responsible for the information to be stored by the LMS. The data sent to the LMS is permitted to be any valid representation of a characterstring. The LMS shall at least provide the smallest permitted maximum of 64000 characters. A characterstring that is greater than 64000 characters is not guaranteed to be stored in its entirety by an LMS. The intent is for the SCO to store data for later use in the current learner session or subsequent learner sessions between SCOs for the same learner. Since the SCO is responsible for the format of the adl.data.n.store, the LMS shall not attempt to interpret or change this data in any way. The availability of this data on subsequent attempts on the content is dependent on the value set in the manifest for the <organization> attribute adlcp:sharedDataGlobalToSystem. o true (default) – the data stored in the adl.data collection will be retained for every learner attempt on the content. o false – the data stored in the adl.data collection will be cleared upon termination of the learner attempt. On subsequent learner attempts on the content, the LMS will provide a new adl.data collection. Access to the data stored in the collection is controlled in the manifest and is managed per <item> element that references a SCO. (See the SCORM CAM book for details) Example: SetValue(“adl.data.n.store”,“<data><intID>1001</intID><ans>A</ans></dat a>”) SetValue(“adl.data.n.store”,“A1;B2;C11-3”) |
This page intentionally left blank.