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.
Coverage
The vast majority of H5P content types send answered or completed statements with score and the user's answers when the user completes a task. They do the same for sub tasks and also send statements in the beginning (attempted).
We unfortunately don´t maintain a detailed overview of the xAPI statements we send anymore. Many content types send more statements than described above. Statements when changing pages ("progressed") is common in many content types for instance.
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
jackrabbithanna
Thu, 02/06/2020 - 15:02
Permalink
Tincan State
Has anyone ever developed a mod or updated Course Presentation content type, that stores and fetches Tin Can State in between slides, so that if a user refreshes the page they can start over where they left off? Are there any content types that save/fetch state?
BV52
Thu, 02/06/2020 - 18:06
Permalink
Hi jackrabbithanna,If you are
Hi jackrabbithanna,
If you are hosting your content using Moodle, Drupal or Wordpress there is a built in feature 'save content state' that does exactly what you mentioned above. Please note that not all content types support this but Course Presentation does.
-BV
laphatphitcha
Sun, 12/06/2020 - 11:57
Permalink
Because it's not showed in
Because it's not showed in the current page. I wonder that are now "Interactive book" and "Document tools" also currently supporting xAPI? Thank you
BV52
Mon, 12/07/2020 - 17:58
Permalink
Hi laphatphitcha,Short answer
Hi laphatphitcha,
Short answer yes, below is a list a created a few weeks ago. Please note that this is based on contents that are available in H5P.com so there may be a few that I failed to include.
Brancing Scenario
Column
Course Presentation
Dictation
Documentation Tool
Drag and Drop
Drag the Words
Essay
Fill in the Blanks
Flashcards
Image Sequencing
Interactive Book
Interactive Video
Mark the Words
Multiple Choice
Quiz (Question Set)
Single Choice Set
Summary
True/False
-BV
jmartin316
Tue, 09/24/2024 - 21:35
Permalink
H5P with xPAI
Is there an update to this list? Or how can I query H5P.org to discover the list of xAPI compatible H5P types for myself?
jmartin316
Thu, 09/26/2024 - 17:49
Permalink
How?
How can I determine if an H5P question type is xAPI compatible myself? How can I get the latest complete list of xAPI H5P questions type?
TMDC City
Wed, 03/30/2022 - 16:39
Permalink
MyCred H5P Intergration
HI, I was able to get the book to fuction properly but cant get it to register as a log entry to award point. I have mycred, mycredh5p, and H5PxAPIkatchu for WordPress. Am I missing something?