scorm-again 1.6.0 → 1.7.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/.circleci/config.yml +4 -9
- package/README.md +7 -3
- package/dist/aicc.js +787 -690
- package/dist/aicc.js.map +1 -0
- package/dist/aicc.min.js +40 -7263
- package/dist/scorm-again.js +1075 -980
- package/dist/scorm-again.js.map +1 -0
- package/dist/scorm-again.min.js +52 -10873
- package/dist/scorm12.js +618 -510
- package/dist/scorm12.js.map +1 -0
- package/dist/scorm12.min.js +34 -5500
- package/dist/scorm2004.js +704 -579
- package/dist/scorm2004.js.map +1 -0
- package/dist/scorm2004.min.js +40 -6884
- package/package.json +35 -27
- package/src/BaseAPI.js +55 -38
- package/src/constants/response_constants.js +2 -2
- package/test/Scorm2004API.spec.js +37 -7
- package/webpack.js +78 -0
- package/gruntfile.js +0 -90
package/.circleci/config.yml
CHANGED
|
@@ -19,11 +19,6 @@ jobs:
|
|
|
19
19
|
steps:
|
|
20
20
|
- checkout
|
|
21
21
|
|
|
22
|
-
# Update npm
|
|
23
|
-
- run:
|
|
24
|
-
name: update-npm
|
|
25
|
-
command: 'sudo npm install -g npm@latest'
|
|
26
|
-
|
|
27
22
|
# Download and cache dependencies
|
|
28
23
|
- restore_cache:
|
|
29
24
|
keys:
|
|
@@ -31,7 +26,7 @@ jobs:
|
|
|
31
26
|
# fallback to using the latest cache if no exact match is found
|
|
32
27
|
- v1-dependencies-
|
|
33
28
|
|
|
34
|
-
- run:
|
|
29
|
+
- run: yarn install
|
|
35
30
|
|
|
36
31
|
- save_cache:
|
|
37
32
|
paths:
|
|
@@ -42,7 +37,7 @@ jobs:
|
|
|
42
37
|
|
|
43
38
|
# Run mocha
|
|
44
39
|
- run:
|
|
45
|
-
name:
|
|
40
|
+
name: yarn test
|
|
46
41
|
command: ./node_modules/.bin/nyc ./node_modules/.bin/mocha --require @babel/register --recursive --timeout=10000 --exit --reporter mocha-junit-reporter --reporter-options mochaFile=test-results/mocha/results.xml
|
|
47
42
|
when: always
|
|
48
43
|
|
|
@@ -78,7 +73,7 @@ jobs:
|
|
|
78
73
|
|
|
79
74
|
# run babel compile
|
|
80
75
|
- run: git config user.email "jputney@noverant.com" && git config user.name "Jonathan Putney"
|
|
81
|
-
- run: ./node_modules/.bin/
|
|
76
|
+
- run: ./node_modules/.bin/webpack --bail --config webpack.js
|
|
82
77
|
- run: git add --all dist/
|
|
83
78
|
|
|
84
79
|
# run jsdoc
|
|
@@ -101,4 +96,4 @@ jobs:
|
|
|
101
96
|
|
|
102
97
|
- store_artifacts: # upload test coverage as artifact
|
|
103
98
|
path: ./coverage/lcov.info
|
|
104
|
-
prefix: tests
|
|
99
|
+
prefix: tests
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[](https://circleci.com/gh/jcputney/scorm-again) [](https://codeclimate.com/github/jcputney/scorm-again) [](https://codeclimate.com/github/jcputney/scorm-again/trends/test_coverage_total) [](https://codeclimate.com/github/jcputney/scorm-again/trends/technical_debt) [ ](https://app.snyk.io/org/jcputney/projects?origin[]=github)   [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=NF5MPZJAV26LE) [](https://gitter.im/jcputney/scorm-again)
|
|
1
|
+
[](https://circleci.com/gh/jcputney/scorm-again) [](https://codeclimate.com/github/jcputney/scorm-again) [](https://codeclimate.com/github/jcputney/scorm-again/trends/test_coverage_total) [](https://codeclimate.com/github/jcputney/scorm-again/trends/technical_debt) [ ](https://app.snyk.io/org/jcputney/projects?origin[]=github)   [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=NF5MPZJAV26LE) [](https://gitter.im/jcputney/scorm-again) [](https://www.npmjs.com/package/scorm-again)
|
|
2
2
|
|
|
3
3
|
# SCORM Again
|
|
4
4
|
This project was created to modernize the SCORM JavaScript runtime, and to provide a stable, tested platform for running AICC, SCORM 1.2, and SCORM 2004 modules. This module is designed to be LMS agnostic, and is written to be able to be run without a backing LMS, logging all function calls and data instead of committing, if an LMS endpoint is not configured.
|
|
@@ -59,7 +59,11 @@ The APIs include several settings to customize the functionality of each API:
|
|
|
59
59
|
| `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. |
|
|
60
60
|
| `selfReportSessionTime` | false | true/false | Should the API override the default `session_time` reported by the module? Useful when modules don't properly report time. |
|
|
61
61
|
| `alwaysSendTotalTime` | false | true/false | Should the API always send `total_time` when committing to the LMS |
|
|
62
|
+
| `xhrWithCredentials` | false | true/false | Sets the withCredentials flag on the request to the LMS |
|
|
63
|
+
| `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 |
|
|
62
64
|
| `responseHandler` | function | | A function to properly tranform 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 }` |
|
|
65
|
+
| `requestHandler` | function | | A function to transform the commit object before sending it to `lmsCommitUrl`. By default it's the identity function (no transformation). |
|
|
66
|
+
| `onLogMessage` | function | | A function to be called whenever a message is logged. Defaults to console.{error,warn,info,debug,log} |
|
|
63
67
|
|
|
64
68
|
## Initial Values
|
|
65
69
|
|
|
@@ -266,8 +270,8 @@ I welcome any and all feedback and contributions to this project! I'm sure it wo
|
|
|
266
270
|
#### Setup and Development
|
|
267
271
|
You will need `node` installed on your local machine, and you'll have to run `npm install` in the repo directory before starting development.
|
|
268
272
|
|
|
269
|
-
To run a build, you need to just run the `
|
|
273
|
+
To run a build, you need to just run the `yarn run compile` command in the root of the project.
|
|
270
274
|
|
|
271
|
-
Similarly, to run the tests, you just run the `
|
|
275
|
+
Similarly, to run the tests, you just run the `yarn test` command.
|
|
272
276
|
|
|
273
277
|
Before submitting pull requests, please also run `eslint ./src --fix` against your code first, otherwise your pull request build could fail.
|