H5P and xAPI (aka Tin Can)
In the February Release of H5P the xAPI integration is introduced. H5P's current approach is to generate xAPI statements and make them available through javascript events.
The xAPI events are made available externally and also used by H5P internally. It is used between interactive video and the questiontypes for the interactivities and to calculate total scores, it is used by Questionset to know when a question has been attempted and by H5P core to store the total scores in the database.
For other web sites there is an amazing amount of oppurtunities created by the xAPI integration. Some things that may be done:
- Open new content the moment a prerequisite has been completed
- Implement a facebook like feed "James attempted the US Presidents Quiz" - "James completed the US Presidents Quiz with 45 out of 47 points!"
- Open a chat window between a student and a teacher the moment a student attempts a question
- With more statements added a teacher may step through everything a student did within a learning resource
- May be used to track what users of an interactive online advertisement does with the ad
To listen for events a developer adds somethink like:
H5P.externalDispatcher.on('xAPI', function(event) {console.log(event.data.statement)});
And she'll get all the events generated by H5P and may choose to store them, act upon them or just pass them along to another system.
Currently H5P triggers events for completed and attempted. A completed event looks like this:
{
"actor":{
"name":"falcon",
"mbox":"mailto:[email protected]",
"objectType":"Agent"
},
"verb":{
"id":"http://adlnet.gov/expapi/verbs/completed",
"display":{
"en-US":"completed"
}
},
"object":{
"id":"http://h5p.org/node/611",
"objectType":"Activity",
"extensions":{
"http://h5p.org/x-api/h5p-local-content-id":837
}
},
"result":{
"score":{
"min":0,
"max":3,
"raw":2
}
}
}
What do you think we should do next with our xAPI integration?
- Add more statements?
- Add integrations for popular LRSs like Learning Locker and Scorm Cloud?
- Add more data to our current statements like the users answers to a question?
- Anything else?
rickhumphries
Thu, 02/19/2015 - 15:08
Permalink
xAPI
Great work guys. This is a big step forward. I'd love to see integrations with Learning Locker and maybe the 'success' property added to interactions too for the result field :)
falcon
Fri, 02/20/2015 - 09:44
Permalink
Noted! Thanks for reporting :
rickhumphries
Fri, 02/20/2015 - 12:16
Permalink
I'm not sure how it would
I'm not sure how it would work for all content types, but in the Question Set content type there is already a 'Pass Percentage' field included. So the success boolean in the xAPI statement could be taken from that
falcon
Fri, 02/20/2015 - 15:24
Permalink
Yeah, questionset has that. I
mmikko
Thu, 02/19/2015 - 18:26
Permalink
Ambitious idea
I'm fairly certain that if you could somehow deliver a way for people to use powerpoints as starting point and then enchace content drawn from them, you would have potentially huge audience to catch. ISpring seems to be leader currently (?) in turning powerpoints to html5 and we are currently testing using "snippets" converted from powerpoint files by their software to html5 format and in between of those using exercises powered by h5p. If this process could be done any easier, that would be great - while powerpoint has its limitations, educators in all kind of organisations from universities to big companies have huge amount of material in them.
rickhumphries
Thu, 02/19/2015 - 19:14
Permalink
Relevance
Not to be rude mmikko but how is this relevant to xAPI?
mmikko
Tue, 03/03/2015 - 08:15
Permalink
I'm not sure, but couldn't
I'm not sure, but couldn't xAPI be used to deliver information about powerpoint events (like "the slideshow has ended" or "the slideshow is on page X")?
agranet
Wed, 03/18/2015 - 14:27
Permalink
Integration with learning locker
This integration would be a great step forward as far as reporting is concerned.
We are currently looking into it. Anyway we can help ?
falcon
Thu, 03/19/2015 - 11:26
Permalink
Our current strategy is to
McGo
Fri, 03/20/2015 - 07:34
Permalink
Drupal 7.x Module
I am interested in helping on the Drupal die. We evaluated h5p and want to use it in an ongoing project, using both Drupal and Learning Locker as LRS. How can we get this thing running? How are you planning on making the statements available for the platform?
McGo
Fri, 03/20/2015 - 07:35
Permalink
Not Drupal die. And no
Not Drupal die. And no kittens, too. Should have been 'side' :D
falcon
Fri, 03/20/2015 - 21:09
Permalink
Yes, let's keep those kittens
Yes, let's keep those kittens alive :) Currently we're only making the events available client side so you would add a script that listens for them and sends them to LearningLocker directly or via your server via ajax for improved security(server to server communications will make sure that the user in the statement is the logged in user)
You listen for statements with H5P.externalDispatcher.on('xAPI', yourHandler);
The statement itself will be in event.data.statement. The xAPI event also has some helper functions.
berthelemy
Tue, 07/14/2015 - 16:23
Permalink
Wordpress xAPI plugin for H5P
Hi there,
Do you know of anyone who is currently creating a Wordpress plugin that can handle the xAPI calls from H5P?
Thanks,
Mark
falcon
Thu, 07/16/2015 - 21:56
Permalink
Hi,
Hi,
We're working with http://www.nextsoftwaresolutions.com/grassblade-xapi-companion/ now so hopefully their plugin will soon be able to handle H5P!
berthelemy
Fri, 07/17/2015 - 10:34
Permalink
Wordpress xAPI plugin for H5P
That's excellent news. Next Software are doing really good work in this area.
Mark
olympias
Thu, 10/01/2015 - 08:45
Permalink
Updates with Next Software
Hi! Any updates with next software being able to read and store h5p content? Thank you!
falcon
Mon, 10/05/2015 - 09:08
Permalink
We talked to them in
Richard_elearns
Mon, 10/19/2015 - 10:01
Permalink
Great that you are continuing to push xAPI, more opportunities
Great to hear that you are continuing to build on the xAPI functionality.
nolthafer
Thu, 09/07/2017 - 19:19
Permalink
Translating H5P activity responses into Learning Locker export
Hi there.
We are sending xAPI statments to LL and are noticing that the output of the responses in the Learning Locker report is not in a useful format. Is there a way to "translate" those answer values into a more human readable format?
tim
Fri, 09/08/2017 - 09:16
Permalink
Hi! Have you tried making
Hi! Have you tried making visualizations out of the responses? The data is not 'meant' to be very human readable but rather contain enough information for reports to be generated.
nolthafer
Fri, 09/08/2017 - 17:39
Permalink
Learning Locker Visualizations
Hi Tim
No - we have not tried building dashboards in Learning Locker. We were hoping just to parse the answers into the .csv extract to start, similar to the solution detailed here (VLookup of the ID info from the tincan.xml file generated by Storyline export).
Right not, this is what we see in the result response field of the .csv extract from an H5P activity - 4[,]2[,]6
Not very helpful. We can see in the interaction details in LL what each of these values maps to but I'm hoping to get this somehow w/out building custom APIs or reports as our technical knowledge in working w/ these types of reports is very limited at the moment.
{
"version": "1.0.0",
"actor": {
"objectType": "Agent",
"account": {
"name": "445d525e-3384-446f-bd10-bdfd479b1564",
"homePage": "https://wisc-dev.pb.unizin.org/polisci160"
}
},
"verb": {
"id": "http://adlnet.gov/expapi/verbs/answered",
"display": {
"en-US": "answered"
}
},
"object": {
"objectType": "Activity",
"id": "https://wisc-dev.pb.unizin.org/polisci160/wp-admin/admin-ajax.php?action=h5p_embed&id=1?subContentId=2bf13265-5edf-452c-ae11-679e012faeac",
"definition": {
"extensions": {
"http://h5p.org/x-api/h5p-local-content-id": 1,
"http://h5p.org/x-api/h5p-subContentId": "2bf13265-5edf-452c-ae11-679e012faeac"
},
"name": {
"en-US": " \n\nTake a look back at the readings. Which of the fo..."
},
"description": {
"en-US": "\u00a0\n\nTake a look back at the readings. Which of the following does Hobbes NOT discuss as an example of \"instrumental power?\"\n\u00a0\n"
},
"type": "http://adlnet.gov/expapi/activities/cmi.interaction",
"interactionType": "choice",
"correctResponsesPattern": [
"4[,]2[,]6[,]1[,]7[,]0[,]5[,]3"
],
"choices": [
{
"id": "4",
"description": {
"en-US": "Affability\n"
}
},
{
"id": "2",
"description": {
"en-US": "Being feared\n"
}
},
{
"id": "6",
"description": {
"en-US": "Nobility\n"
}
},
{
"id": "1",
"description": {
"en-US": "Reputation for having power\n"
}
},
{
"id": "7",
"description": {
"en-US": "Eloquence\n"
}
},
{
"id": "0",
"description": {
"en-US": "Riches\n"
}
},
{
"id": "5",
"description": {
"en-US": "Reputation for prudence\n"
}
},
{
"id": "3",
"description": {
"en-US": "Success\n"
}
}
]
}
},
"context": {
"contextActivities": {
"parent": [
{
"objectType": "Activity",
"id": "https://wisc-dev.pb.unizin.org/polisci160/wp-admin/admin-ajax.php?action=h5p_embed&id=1"
}
],
"category": [
{
"objectType": "Activity",
"id": "http://h5p.org/libraries/H5P.MultiChoice-1.9"
}
],
"grouping": [
{
"objectType": "Activity",
"id": "https://wisc-dev.pb.unizin.org/polisci160/chapter/hobbes-and-power-ii/",
"definition": {
"type": "http://activitystrea.ms/schema/1.0/page",
"name": {
"en": " | Hobbes and Power II"
},
"moreInfo": "https://wisc-dev.pb.unizin.org/polisci160/chapter/hobbes-and-power-ii/"
}
}
]
},
"extensions": {
"http://id.tincanapi.com/extension/ending-point": 1
}
},
"result": {
"score": {
"min": 0,
"max": 8,
"raw": 3,
"scaled": 0.375
},
"completion": true,
"success": false,
"duration": "PT3.83S",
"response": "4[,]2[,]6"
},
"authority": {
"objectType": "Agent",
"name": "Unizin PressBooks Dev",
"mbox": "mailto:[email protected]"
},
"stored": "2017-09-07T12:00:23.653800-05:00",
"timestamp": "2017-09-07T12:00:23.653800-05:00",
"id": "dfd801bb-b9ed-4721-b779-15691bc69534"
}
Thx
Nicole
tim
Mon, 09/11/2017 - 10:08
Permalink
Hi Nicole,So the
Hi Nicole,
So the 'correctResponsePattern' is a comma seperated array of the correct responses according to the ids specified further down in the field. In this case it seems like all the answers are correct.
Let's say you have 3 questions with the follwing id's:
1,2,3
but only 2 and 3 are correct. The correct response pattern would be 2[,]3.
You can have a look at the documentation here:
https://h5p.org/node/3428
for a bit more information about how the xAPI data is built up for MultiChoice.
It is possible to parse this data into a CSV file, the most pertinent information would be the 'description' section and the 'result' section. It will take some research but it shouldn't be more than a few lines of code.
Let me know if you have any other questions!
nolthafer
Mon, 09/11/2017 - 15:46
Permalink
parsing data into csv file
Hi Tim
THanks for the response regarding parsing the data into a CSV, how would that happen? I'm only seeing 31 standard statements in Learning Locker to report on. Do you have ideas / recommendations on HOW to pull the description and result section out of Learning Locker? It's obviously stored there, just not sure how to report on it / pull the data.
Thx
Nicole
tim
Thu, 09/14/2017 - 09:55
Permalink
First, you have to export the
First, you have to export the data from Learning Locker. Then I would write a small javascript or python program to loop through the JSON and pull out the relevant data.
If you would like to build a visualization on Learning Locker, I suggest having a look at their tutorials:
https://www.youtube.com/watch?v=T8RjzqrcP6A
tim
Thu, 09/14/2017 - 09:57
Permalink
You may not even have to
You may not even have to write a program after all.. It seems like there are some online JSON to CSV converters:
https://konklone.io/json/
In any case, I would recommend speaking to a developer in your organization about this :)