Add custom xAPI events for action toolbar buttons
parent
9abe7ef321
commit
e548b3575f
|
@ -308,5 +308,10 @@ H5P.XAPIEvent.allowedXAPIVerbs = [
|
||||||
'shared',
|
'shared',
|
||||||
'suspended',
|
'suspended',
|
||||||
'terminated',
|
'terminated',
|
||||||
'voided'
|
'voided',
|
||||||
|
|
||||||
|
// Custom verbs used for action toolbar below content
|
||||||
|
'downloaded',
|
||||||
|
'accessed-embed',
|
||||||
|
'accessed-copyright'
|
||||||
];
|
];
|
||||||
|
|
|
@ -158,16 +158,19 @@ H5P.init = function (target) {
|
||||||
|
|
||||||
actionBar.on('download', function () {
|
actionBar.on('download', function () {
|
||||||
window.location.href = contentData.exportUrl;
|
window.location.href = contentData.exportUrl;
|
||||||
|
instance.triggerXAPI('downloaded');
|
||||||
});
|
});
|
||||||
actionBar.on('copyrights', function () {
|
actionBar.on('copyrights', function () {
|
||||||
var dialog = new H5P.Dialog('copyrights', H5P.t('copyrightInformation'), copyrights, $container);
|
var dialog = new H5P.Dialog('copyrights', H5P.t('copyrightInformation'), copyrights, $container);
|
||||||
dialog.open();
|
dialog.open();
|
||||||
|
instance.triggerXAPI('accessed-copyright');
|
||||||
});
|
});
|
||||||
actionBar.on('embed', function () {
|
actionBar.on('embed', function () {
|
||||||
H5P.openEmbedDialog($actions, contentData.embedCode, contentData.resizeCode, {
|
H5P.openEmbedDialog($actions, contentData.embedCode, contentData.resizeCode, {
|
||||||
width: $element.width(),
|
width: $element.width(),
|
||||||
height: $element.height()
|
height: $element.height()
|
||||||
});
|
});
|
||||||
|
instance.triggerXAPI('accessed-embed');
|
||||||
});
|
});
|
||||||
|
|
||||||
if (actionBar.hasActions()) {
|
if (actionBar.hasActions()) {
|
||||||
|
|
Loading…
Reference in New Issue