Made user results work in new embed.
parent
971a55df58
commit
f76290cdde
|
@ -11,7 +11,7 @@ H5P.Event = function(type, data) {
|
||||||
};
|
};
|
||||||
|
|
||||||
H5P.EventDispatcher = (function () {
|
H5P.EventDispatcher = (function () {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base of the event system.
|
* The base of the event system.
|
||||||
* Inherit this class if you want your H5P to dispatch events.
|
* Inherit this class if you want your H5P to dispatch events.
|
||||||
|
@ -152,4 +152,4 @@ H5P.EventDispatcher = (function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
return EventDispatcher;
|
return EventDispatcher;
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -79,7 +79,7 @@ H5P.XAPIEvent.prototype.getVerb = function(full) {
|
||||||
H5P.XAPIEvent.prototype.setObject = function(instance) {
|
H5P.XAPIEvent.prototype.setObject = function(instance) {
|
||||||
if (instance.contentId) {
|
if (instance.contentId) {
|
||||||
this.data.statement.object = {
|
this.data.statement.object = {
|
||||||
'id': H5PIntegration.getContentUrl(instance.contentId),
|
'id': H5P.contentDatas['cid-' + instance.contentId].url,
|
||||||
'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
|
||||||
|
@ -98,10 +98,9 @@ H5P.XAPIEvent.prototype.setObject = function(instance) {
|
||||||
* Helper function to set the actor, email and name will be added automatically
|
* Helper function to set the actor, email and name will be added automatically
|
||||||
*/
|
*/
|
||||||
H5P.XAPIEvent.prototype.setActor = function() {
|
H5P.XAPIEvent.prototype.setActor = function() {
|
||||||
var user = H5PIntegration.getUser();
|
|
||||||
this.data.statement.actor = {
|
this.data.statement.actor = {
|
||||||
'name': user.name,
|
'name': H5P.user.name,
|
||||||
'mbox': 'mailto:' + user.mail,
|
'mbox': 'mailto:' + H5P.user.mail,
|
||||||
'objectType': 'Agent'
|
'objectType': 'Agent'
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,7 +3,7 @@ var H5P = H5P || {};
|
||||||
// Create object where external code may register and listen for H5P Events
|
// Create object where external code may register and listen for H5P Events
|
||||||
H5P.externalDispatcher = new H5P.EventDispatcher();
|
H5P.externalDispatcher = new H5P.EventDispatcher();
|
||||||
|
|
||||||
if (window.top !== window.self && window.top.H5P !== undefined && window.top.H5P.externalDispatcher !== undefined) {
|
if (H5P.isFramed && H5P.externalEmbed === false) {
|
||||||
H5P.externalDispatcher.on('xAPI', window.top.H5P.externalDispatcher.trigger);
|
H5P.externalDispatcher.on('xAPI', window.top.H5P.externalDispatcher.trigger);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue