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
[email protected]
Tue, 04/02/2019 - 21:38
Permalink
Interactive video xAPI
Hi I've added a event listener through h5pmods_alter_scripts. When I run a page with a interactive video the script logs one object to the console then goes silent. When I add the slideshow to the same page each interaction in the slideshow gets a response. I guess this is related to the iframe of the interactive video but I got the impression that if I hosted my own content and added the script in this way it should be working. Any idea about what I'm missing?
Thanks a bunch Jorgen
H5P.externalDispatcher.on('xAPI', function(event) {// Handle the event here, the statement is within event.data.statementconsole.log(event.data.statement);});tpan
Tue, 04/09/2019 - 10:56
Permalink
Branching Scenario xAPI
Hello,
Will there be xAPI support for the new content type Branching Scenario?
I installed it last week and seems very promising to make interactive content with decisions from the learner.
And a more general question, are there any progress to get xAPI data for Moodle in a simpler way then explained here?
Regards,
tpan
BV52
Tue, 04/09/2019 - 11:45
Permalink
Hi tpan,Moodle comes with a
Hi tpan,
Moodle comes with a built in Gradebook that captures the xAPI statements that H5Ps emits. Having said this scores from the Branching Scenario are sent to the Gradebook. You just need to make sure that the scoring is set in the Branching Scenario. You can see more details regarding this in the built in "tutorial" in Branching scenario just click on the question mark icon on the left panel.
-BV52
tpan
Tue, 04/09/2019 - 11:56
Permalink
Thanks for the quick reply
Thanks for the quick reply BV52,
I think I could not express my question correctly. For the grading part, I am aware of Gradebook option and the overall grade of each activity is sent to Moodle`s Gradebook.
I want to learn how I can get more information about learner`s behaviour inside H5P content ( which branches they followed, what answers they gave to each question, how many times they watched a video, did they follow the recommendations inside an interactive video etc.)
As I know, for other content types, such as Multiple Choice or Interactive Video, additional tools are required to get xAPI statements.
and currently Branching Scenario is not listed in the content types supporting xAPI.
Best regards,
tpan
BV52
Thu, 04/11/2019 - 07:27
Permalink
Hi tpan,Currently the
Hi tpan,
Currently the Branching Scenario provides the scores for the quizzes and the branches that the user went through. It does not provide details such how many times they watched a video, did they follow the recommendations inside an interactive video etc.
-BV52
coreywi
Wed, 04/24/2019 - 22:51
Permalink
modify the saveResult AJAX call?
Hello All.
A page with a 'Fill in the Blanks' content-type is trying to POST to 'saveResult' to a custom server. My server's REST API requires an Authorization header to be included in order to process the request.
Is it posible to hook into the ajax call to add to the header?
Thanks!
Corey.
aritogil
Wed, 05/15/2019 - 10:25
Permalink
Html5, No wordpress,moodle and Drupal.
Can I use h5p inside my website without internet connection? If i can, how could I implement it?
BV52
Thu, 05/16/2019 - 03:01
Permalink
Hi aritogil,I suggest that
Hi aritogil,
I suggest that you visit this thread for details. There are also some plans in the Roadmap although we do not have a timeline yet when this will be completed.
-BV52
Sébastien Fraysse
Tue, 07/02/2019 - 10:35
Permalink
Moodle plugin to catch H5P xAPI events
Just to let you know, there is a new plugin that catches the H5P xAPI events and send them to an LRS. It's called "TRAX Logs" and it's available here: https://github.com/trax-project/moodle-trax-logs
There is a page dedicated to H5P in the documentation : https://github.com/trax-project/moodle-trax-logs/blob/master/doc/h5p.md
The project page (currently in French): http://traxproject.fr
I would love to hear your feedback!
Sébastien