scorm-again 2.2.0 → 2.4.0
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/README.md +2 -1
- package/dist/aicc.js +3161 -2799
- package/dist/aicc.js.map +1 -1
- package/dist/aicc.min.js +1 -1
- package/dist/aicc.min.js.map +1 -1
- package/dist/esm/aicc.js +4569 -0
- package/dist/esm/aicc.js.map +1 -0
- package/dist/esm/aicc.min.js +2 -0
- package/dist/esm/aicc.min.js.map +1 -0
- package/dist/esm/scorm-again.js +6955 -0
- package/dist/esm/scorm-again.js.map +1 -0
- package/dist/esm/scorm-again.min.js +2 -0
- package/dist/esm/scorm-again.min.js.map +1 -0
- package/dist/esm/scorm12.js +3637 -0
- package/dist/esm/scorm12.js.map +1 -0
- package/dist/esm/scorm12.min.js +2 -0
- package/dist/esm/scorm12.min.js.map +1 -0
- package/dist/esm/scorm2004.js +4631 -0
- package/dist/esm/scorm2004.js.map +1 -0
- package/dist/esm/scorm2004.min.js +2 -0
- package/dist/esm/scorm2004.min.js.map +1 -0
- package/dist/scorm-again.js +4498 -4082
- package/dist/scorm-again.js.map +1 -1
- package/dist/scorm-again.min.js +1 -1
- package/dist/scorm-again.min.js.map +1 -1
- package/dist/scorm12.js +3074 -2756
- package/dist/scorm12.js.map +1 -1
- package/dist/scorm12.min.js +1 -1
- package/dist/scorm12.min.js.map +1 -1
- package/dist/scorm2004.js +2430 -2221
- package/dist/scorm2004.js.map +1 -1
- package/dist/scorm2004.min.js +1 -1
- package/dist/scorm2004.min.js.map +1 -1
- package/index.d.ts +70 -0
- package/package.json +11 -8
- package/src/AICC.ts +6 -4
- package/src/BaseAPI.ts +38 -21
- package/src/Scorm12API.ts +24 -29
- package/src/Scorm2004API.ts +13 -18
- package/src/ScormAgain.ts +9 -0
- package/src/constants/default_settings.ts +1 -0
- package/src/types/api_types.ts +1 -0
- package/test/AICC.spec.ts +2 -2
- package/test/Scorm12API.spec.ts +73 -2
- package/test/Scorm2004API.spec.ts +18 -18
- package/webpack.config.js +38 -15
- package/src/exports/aicc.js +0 -3
- package/src/exports/scorm-again.js +0 -7
- package/src/exports/scorm12.js +0 -3
- package/src/exports/scorm2004.js +0 -3
- package/src/utilities/debounce.ts +0 -31
- package/test/utilities/debounce.spec.ts +0 -56
package/README.md
CHANGED
|
@@ -104,9 +104,10 @@ The APIs include several settings to customize the functionality of each API:
|
|
|
104
104
|
| `mastery_override` | false | true/false | (SCORM 1.2) Used to override a module's `cmi.core.lesson_status` so that a pass/fail is determined based on a mastery score and the user's raw score, rather than using whatever status is provided by the module. An example of this would be if a module is published using a `Complete/Incomplete` final status, but the LMS always wants to receive a `Passed/Failed` for quizzes, then we can use this setting to override the given final status. |
|
|
105
105
|
| `selfReportSessionTime` | false | true/false | Should the API override the default `session_time` reported by the module? Useful when modules don't properly report time. |
|
|
106
106
|
| `alwaysSendTotalTime` | false | true/false | Should the API always send `total_time` when committing to the LMS |
|
|
107
|
+
| `fetchMode` | 'cors' | 'cors', 'no-cors', 'same-origin', 'navigate' | The fetch mode to use when sending requests to the LMS. |
|
|
107
108
|
| `xhrWithCredentials` | false | true/false | Sets the withCredentials flag on the request to the LMS |
|
|
108
109
|
| `xhrHeaders` | {} | Object | This allows setting of additional headers on the request to the LMS where the key should be the header name and the value is the value of the header you want to send |
|
|
109
|
-
| `responseHandler` | function | | A function to properly
|
|
110
|
+
| `responseHandler` | function | | A function to properly transform the response from the LMS to the correct format. The APIs expect the result from the LMS to be in the following format (errorCode is optional): `{ "result": true, "errorCode": 0 }` |
|
|
110
111
|
| `requestHandler` | function | | A function to transform the commit object before sending it to `lmsCommitUrl`. By default it's the identity function (no transformation). |
|
|
111
112
|
| `onLogMessage` | function | | A function to be called whenever a message is logged. Defaults to console.{error,warn,info,debug,log} |
|
|
112
113
|
| `scoItemIds` | [] | string[] | A list of valid SCO IDs to be used for choice/jump sequence validation. |
|