-
Notifications
You must be signed in to change notification settings - Fork 1
/
api.js
25 lines (25 loc) · 821 Bytes
/
api.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/**
* XXX: faking an LMS provided SCORM API
* Include this before `getAPI` is called
*/
window.API = (function (){
var data = {
"cmi.core.student_id": "000000"
, "cmi.core.student_name": "Mangs, Sune"
, "cmi.core.lesson_status": "not attempted"
, "cmi.core.lesson_location": ""
};
return {
"LMSInitialize": function() { return "true"; }
, "LMSCommit": function() { return "true"; }
, "LMSFinish": function() { return "true"; }
, "LMSGetValue": function(model) { return data[model] || ""; }
, "LMSSetValue": function(model, value) {
data[model] = value;
return "true";
}
, "LMSGetLastError": function () { return "0"; }
, "LMSGetErrorString": function () { return "No error"; }
, "LMSGetDiagnostic": function () { return "No error"; }
};
}());