Skip to content

Commit

Permalink
Merge pull request #88 from tunapanda/fix/expose-object-iri
Browse files Browse the repository at this point in the history
fix: add missing xAPI object unique field identifier
  • Loading branch information
0xMurage committed Jun 17, 2021
2 parents 462b357 + 0fb7da4 commit ecbcf2a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ The standalone H5P player constructor accepts two arguments.
`export` |false| A boolean on whether display a download button.
`icon` |false| A boolean on whether display H5P icon
`downloadUrl` |false| A path or a url that returns zipped h5p for download. The link is used by H5P `export` button
`fullScreen` |false| A boolean on whether to enable fullscreen button if browser supports the feature. Default is `false`
`fullScreen` |false| A boolean on whether to enable fullscreen button if browser supports the feature. Default is `false`|
`xAPIObjectIRI`|false| An identifier for a single unique Activity ~ utilized when generating xAPI [object](https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#acturi) field. Default is page host+pathname

**Note:**
- One can use absolute URL for `frameCss`, `frameJs`, and for other path options(`h5pJsonPath`,`librariesPath`, & `librariesPath`)
Expand Down
2 changes: 1 addition & 1 deletion dist/main.bundle.js

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion src/js/h5p-standalone.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ export default class H5PStandalone {

const contentOptions = {
displayOptions,
fullScreen: false
fullScreen: false,
url: window.location.href.split('?')[0].split('#')[0]
};

if (options.downloadUrl) {
Expand Down Expand Up @@ -84,6 +85,11 @@ export default class H5PStandalone {
contentOptions.fullScreen = options.fullScreen
}

if (options.xAPIObjectIRI) {
contentOptions.url = options.xAPIObjectIRI; //no validation
}


this.initElement(el);
return this.initH5P(generalIntegrationOptions, contentOptions);
}
Expand Down

0 comments on commit ecbcf2a

Please sign in to comment.