H5P and xAPI
xAPI (Tin Can) enable H5P to communicate with the publishing platform about what the user does and achieves.
You can't embed H5P from an external site and use JavaScript on your own site to track what the learner does within the H5P content. The example code here only works if the content and the code is hosted on the same site.
H5P's approach is to generate xAPI statements and make them available through events in JavaScript.
To listen for xAPIevents a developer adds:
H5P.externalDispatcher.on('xAPI', eventHandler);
Where the xAPI statement is to be found in event.data.statement. The event will be an XAPIEvent with many functions that makes working with it easier - see the API reference.
Example
To try this out type the following in your browser's console when using an H5P object on a website:
H5P.externalDispatcher.on('xAPI', function (event) { console.log(event.data.statement); });
You should now see xAPI statements in your console.
If you, for instance, need to do something if the user gets full score you may do something like this:
H5P.externalDispatcher.on('xAPI', function(event){ if (event.getScore() === event.getMaxScore() && event.getMaxScore() > 0){ console.log('do something useful here'); } });
LRS integrations
Since H5P is a plugin for publishing tools H5P does not include its own LRS integration. Instead, H5P generates the statements and makes them available for the publishing platform so that the publishing platform may use its own LRS integration to send H5P's statements to an LRS.
Content types
The following H5P content types are currently supporting xAPI:
- Interactive Video
- Course Presentation
- Drag and Drop
- Drag The Words
- Fill in the blanks
- Find the hotspot
- Mark the words
- Multiple Choice
- Single Choice Set
- Summary
- Quiz (Question Set)
- Memory Game
- Essay
- Image Pairing
Comments
ucalgarycme
Mon, 03/19/2018 - 21:52
Permalink
How to use GrassBlade LRS with H5P content in LearnDash
Hi,
I use LearnDash to host H5P content in my WordPress site. I'm trying to figure out how to use GrassBlade LRS to track completion of H5P content, e.g. Question Set / Quiz. So I'm asking this question to both teams of H5P and GrassBlade LRS: how to make this happen? Thanks!
https://nextsoftwaresolutions.zendesk.com/hc/en-us/articles/204743875-Us...
BV52
Tue, 03/20/2018 - 07:24
Permalink
Hi ucalgarycme,Have you tried
Hi ucalgarycme,
Have you tried looking at this documentation.
-BV52