@didask/scol-r 2.6.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/SCORMAdapter.d.ts +1 -1
- package/lib/SCORMAdapter.js +7 -5
- package/package.json +8 -3
package/lib/SCORMAdapter.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare class SCORMAdapter {
|
|
|
17
17
|
LMSTerminate(): true | void;
|
|
18
18
|
LMSGetValue(name: string): any;
|
|
19
19
|
LMSSetValue(name: string, value: string | number): true | void;
|
|
20
|
-
LMSCommit():
|
|
20
|
+
LMSCommit(): boolean;
|
|
21
21
|
LMSGetLastError(): number;
|
|
22
22
|
LMSGetErrorString(errorCode: number): any;
|
|
23
23
|
LMSGetDiagnostic(errorCode: number): any;
|
package/lib/SCORMAdapter.js
CHANGED
|
@@ -189,7 +189,12 @@ var SCORMAdapter = /** @class */ (function () {
|
|
|
189
189
|
SCORMAdapter.prototype.LMSCommit = function () {
|
|
190
190
|
var _this = this;
|
|
191
191
|
var result = this._callAPIFunction("Commit");
|
|
192
|
-
if (
|
|
192
|
+
if (this.validateResult(result)) {
|
|
193
|
+
return true;
|
|
194
|
+
}
|
|
195
|
+
else if (typeof result === "object" &&
|
|
196
|
+
"then" in result &&
|
|
197
|
+
typeof result.then === "function") {
|
|
193
198
|
result.then(function (success) {
|
|
194
199
|
if (!_this.validateResult(success)) {
|
|
195
200
|
_this._errorCallback("commitFailed");
|
|
@@ -197,10 +202,7 @@ var SCORMAdapter = /** @class */ (function () {
|
|
|
197
202
|
});
|
|
198
203
|
return true;
|
|
199
204
|
}
|
|
200
|
-
|
|
201
|
-
var success = this.validateResult(result);
|
|
202
|
-
return success || this._errorCallback("commitFailed");
|
|
203
|
-
}
|
|
205
|
+
this._errorCallback("commitFailed");
|
|
204
206
|
};
|
|
205
207
|
SCORMAdapter.prototype.LMSGetLastError = function () {
|
|
206
208
|
return parseInt(this._callAPIFunction("GetLastError"));
|
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@didask/scol-r",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.1",
|
|
4
4
|
"description": "Shareable Cross-Origin Learning Resources",
|
|
5
5
|
"main": "index.html",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
7
|
-
"files": [
|
|
7
|
+
"files": [
|
|
8
|
+
"lib/"
|
|
9
|
+
],
|
|
8
10
|
"scripts": {
|
|
9
11
|
"build": "tsc",
|
|
10
12
|
"clean": "rm -rf node_modules lib",
|
|
@@ -14,7 +16,10 @@
|
|
|
14
16
|
"type": "git",
|
|
15
17
|
"url": "git+https://github.com/Didask/scol-r.git"
|
|
16
18
|
},
|
|
17
|
-
"keywords": [
|
|
19
|
+
"keywords": [
|
|
20
|
+
"SCORM",
|
|
21
|
+
"CORS"
|
|
22
|
+
],
|
|
18
23
|
"author": "Didask",
|
|
19
24
|
"license": "ISC",
|
|
20
25
|
"bugs": {
|