Make the xAPI integration work for stuff that aren't content types
parent
0a6dd4808b
commit
a96e5cc7b9
|
@ -78,15 +78,21 @@ H5P.XAPIEvent.prototype.getVerb = function(full) {
|
||||||
* @param {object} instance - the H5P instance
|
* @param {object} instance - the H5P instance
|
||||||
*/
|
*/
|
||||||
H5P.XAPIEvent.prototype.setObject = function(instance) {
|
H5P.XAPIEvent.prototype.setObject = function(instance) {
|
||||||
|
if (instance.contentId) {
|
||||||
this.data.statement.object = {
|
this.data.statement.object = {
|
||||||
// TODO: Correct this. contentId might be vid, and this can't be Drupal
|
|
||||||
// specific
|
|
||||||
'id': H5PIntegration.getContentUrl(instance.contentId),
|
'id': H5PIntegration.getContentUrl(instance.contentId),
|
||||||
'objectType': 'Activity',
|
'objectType': 'Activity',
|
||||||
'extensions': {
|
'extensions': {
|
||||||
'http://h5p.org/x-api/h5p-local-content-id': instance.contentId
|
'http://h5p.org/x-api/h5p-local-content-id': instance.contentId
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Not triggered by an H5P content type...
|
||||||
|
this.data.statement.object = {
|
||||||
|
'objectType': 'Activity'
|
||||||
|
};
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue