APIWrapper.js 文件通常与嵌入 xAPI 调用的 SCORM 结合使用
This project contains a modified SCORM Version 1.2 APIWrapper.js file, a modified SCORM 2004 APIWrapper.js file and a new SCORMToXAPIFunctions.js file that handles automated conversion of SCORM Data Model elements to associated xAPI statements. This wrapper implements the SCORM Data Model conversion as defined in the Experience API SCORM Profile. This document is in draft form. Changes will be made to this wrapper to coincide with changes to the xAPI SCORM Profile.
For detailed technical information on xAPI, read the Experience API Spec
Note that using these wrappers WILL result in xAPI statements about your learners in an LRS. ENSURE THAT YOU UNDERSTAND YOUR LRSs PRIVACY AND SECURITY FEATURES BEFORE IMPLEMENTING THIS APPROACH.
Javascript SCORM 2004 API wrapper with new xAPI object (Implemented in SCORMToXAPIFunctions.js).
This javascript file is typically used in SCORM 2004 courses. If the ADL-provided ADLWrapper.js file is used in your SCORM courses, it can be replaced with this file.
Note: The updated APIWrapper.js file does not stand-alone and MUST be used with the SCORMToXAPIFunctions.js file.
NOTE - THIS VERSION IS CURRENTLY OUT OF DATE. PLEASE SEE THE 2004 WRAPPER UNTIL THIS ISSUE IS ADDRESSED.
Javascript SCORM 1.2 API wrapper with new xAPI object (Implemented in SCORMToXAPIFunctions.js).
This javascript file is typically used in SCORM 1.2 courses. If the ADL-provided ADLWrapper.js file is used in your SCORM courses, it can be replaced with this file.
Note: The updated APIWrapper.js file does not stand-alone and MUST be used with the SCORMToXAPIFunctions.js file.
JavaScript file that implements an "xapi" object that abstracts implementation details of the xAPI SCORM Profile. This object is integrated into the APIWrapper.js file in order to automatically convert SCORM Run-Time communication to associated xAPI statements.
This version of the wrapper supports SCORM 2004 and SCORM 1.2.
The SCORM-to-xAPI-Wrapper relies on external dependencies to perform some actions. Make sure you download the minified xAPI Wrapper to be included in your legacy SCORM courses. Information on integration of this file is included in the Configuration section below.
To update your SCORM 2004 courses to additionally track xAPI statements replace the appropriate APIWrapper.js file (1.2 or 2004 version depending on your SCORM version) with the SCORM-to-xAPI-Wrapper and include two new files:
Next, add the following code in the <head> sections of each SCO in your course. SCO launch files can be identified by looking at the imsmanifest.xml file at the root of the SCORM package. Resource elements with adlcp:scormtype set to "sco" should contain the complete list of SCOs in the course. Each SCO will be an 'activity' tracked by xAPI statements. Paste the following code before the <script> tag that references the APIWrapper.js file.
Notes:
var activity = ;
// ex. var activity = "http://adlnet.gov/courses/example/module1"Finally, several configuration values must be set in the updated APIWrapper.js file (init method). Instructions are also included in the header at the top of the JavaScript file. Near the top of the file, configure the following lines of code:
var config = {
lrs:{
endpoint:"https://lrs.adlnet.gov/xapi/",
user:"",
password:""
},
courseId:"",
lmsHomePage:""
};Currently, the SCORM to xAPI Wrapper handles a subset of SCORM Run-Time behaviors and data model elements. This list will be expanded over time. Currently, the wrapper supports:
The following data model elements or behaviors result in associated xAPI statements:
Core SCO Data
Interactions Data
Behaviors
The following data is stored as either profile or state information
Activity Profile
Identified by:
Data:
Activity State
Identified by:
Data:
Attempt State
Identified by:
Data:
Preferences Data Type (see reference above)
It is strongly recommended that implementers read and understand the Experience API SCORM Profile. Additional data model elements and behaviors identified in this profile will be implemented in a subsequent version.
We welcome contributions to this project. Fork this repository, make changes and submit pull requests. If you're not comfortable with editing the code, please submit an issue and we'll be happy to address it.
Copyright ©2016 Advanced Distributed Learning
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
暂无开放 Issues,或尚未同步最近议题。