scorm-again 1.5.3 → 1.7.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.
@@ -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: npm install
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: npm test
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/grunt
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
@@ -0,0 +1,14 @@
1
+ <component name="ProjectRunConfigurationManager">
2
+ <configuration default="false" name="Mocha Unit Tests" type="mocha-javascript-test-runner">
3
+ <node-interpreter>project</node-interpreter>
4
+ <node-options />
5
+ <mocha-package>$PROJECT_DIR$/node_modules/mocha</mocha-package>
6
+ <working-directory>$PROJECT_DIR$</working-directory>
7
+ <pass-parent-env>true</pass-parent-env>
8
+ <ui>bdd</ui>
9
+ <extra-mocha-options>--watch --require @babel/register</extra-mocha-options>
10
+ <test-kind>PATTERN</test-kind>
11
+ <test-pattern>test/**/*.spec.js</test-pattern>
12
+ <method v="2" />
13
+ </configuration>
14
+ </component>
@@ -0,0 +1,12 @@
1
+ <component name="ProjectRunConfigurationManager">
2
+ <configuration default="false" name="compile" type="js.build_tools.npm" nameIsGenerated="true">
3
+ <package-json value="$PROJECT_DIR$/package.json" />
4
+ <command value="run" />
5
+ <scripts>
6
+ <script value="compile" />
7
+ </scripts>
8
+ <node-interpreter value="project" />
9
+ <envs />
10
+ <method v="2" />
11
+ </configuration>
12
+ </component>
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![CircleCI](https://img.shields.io/circleci/build/github/jcputney/scorm-again/master?style=for-the-badge "CircleCI Build Status")](https://circleci.com/gh/jcputney/scorm-again) [![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability/jcputney/scorm-again?style=for-the-badge)](https://codeclimate.com/github/jcputney/scorm-again) [![Code Climate coverage](https://img.shields.io/codeclimate/coverage/jcputney/scorm-again?style=for-the-badge)](https://codeclimate.com/github/jcputney/scorm-again/trends/test_coverage_total) [![Code Climate technical debt](https://img.shields.io/codeclimate/tech-debt/jcputney/scorm-again?style=for-the-badge)](https://codeclimate.com/github/jcputney/scorm-again/trends/technical_debt) [![Snyk Vulnerabilities for GitHub Repo](https://img.shields.io/snyk/vulnerabilities/github/jcputney/scorm-again?style=for-the-badge) ](https://app.snyk.io/org/jcputney/projects?origin[]=github) ![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/npm/scorm-again?style=for-the-badge) ![npm bundle size](https://img.shields.io/bundlephobia/min/scorm-again?style=for-the-badge) [![donate](https://img.shields.io/badge/paypal-donate-success?style=for-the-badge)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=NF5MPZJAV26LE) [![Gitter](https://img.shields.io/gitter/room/jcputney/scorm-again?style=for-the-badge)](https://gitter.im/jcputney/scorm-again)
1
+ [![CircleCI](https://img.shields.io/circleci/build/github/jcputney/scorm-again/master?style=for-the-badge "CircleCI Build Status")](https://circleci.com/gh/jcputney/scorm-again) [![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability/jcputney/scorm-again?style=for-the-badge)](https://codeclimate.com/github/jcputney/scorm-again) [![Code Climate coverage](https://img.shields.io/codeclimate/coverage/jcputney/scorm-again?style=for-the-badge)](https://codeclimate.com/github/jcputney/scorm-again/trends/test_coverage_total) [![Code Climate technical debt](https://img.shields.io/codeclimate/tech-debt/jcputney/scorm-again?style=for-the-badge)](https://codeclimate.com/github/jcputney/scorm-again/trends/technical_debt) [![Snyk Vulnerabilities for GitHub Repo](https://img.shields.io/snyk/vulnerabilities/github/jcputney/scorm-again?style=for-the-badge) ](https://app.snyk.io/org/jcputney/projects?origin[]=github) ![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/npm/scorm-again?style=for-the-badge) ![npm bundle size](https://img.shields.io/bundlephobia/min/scorm-again?style=for-the-badge) [![donate](https://img.shields.io/badge/paypal-donate-success?style=for-the-badge)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=NF5MPZJAV26LE) [![Gitter](https://img.shields.io/gitter/room/jcputney/scorm-again?style=for-the-badge)](https://gitter.im/jcputney/scorm-again) [![npm](https://img.shields.io/npm/v/scorm-again?color=%2344cc11&style=for-the-badge)](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.
@@ -17,6 +17,11 @@ To begin with, you include either the `scorm-again.js` or `scorm-again.min.js` f
17
17
  <script type="text/javascript" src="/dist/scorm-again.js"></script>
18
18
  ```
19
19
 
20
+ Or, if you would like to only pull in one API, you include either the `aicc.js`, `scorm12.js` or `scorm2004.js` files or their minified versions on your launching page:
21
+ ```html
22
+ <script type="text/javascript" src="/dist/scorm2004.js"></script>
23
+ ```
24
+
20
25
  Or, if you would like to install the library using your package manager, you can do the following:
21
26
  ```sh
22
27
  npm install scorm-again
@@ -54,7 +59,11 @@ The APIs include several settings to customize the functionality of each API:
54
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. |
55
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. |
56
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 |
57
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} |
58
67
 
59
68
  ## Initial Values
60
69
 
@@ -261,8 +270,8 @@ I welcome any and all feedback and contributions to this project! I'm sure it wo
261
270
  #### Setup and Development
262
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.
263
272
 
264
- To run a build, you need to just run the `grunt` command in the root of the project.
273
+ To run a build, you need to just run the `yarn run compile` command in the root of the project.
265
274
 
266
- Similarly, to run the tests, you just run the `grunt test` or `npm test` command.
275
+ Similarly, to run the tests, you just run the `yarn test` command.
267
276
 
268
277
  Before submitting pull requests, please also run `eslint ./src --fix` against your code first, otherwise your pull request build could fail.