Add info about the library being used to the xAPI statements
parent
8431304dd0
commit
03370c9500
|
@ -131,6 +131,17 @@ H5P.XAPIEvent.prototype.setContext = function (instance) {
|
|||
}
|
||||
};
|
||||
}
|
||||
if (instance.libraryInfo) {
|
||||
if (this.data.statement.context === undefined) {
|
||||
this.data.statement.context = {"contextActivities":{}};
|
||||
}
|
||||
this.data.statement.context.contextActivities.category = [
|
||||
{
|
||||
"id": "http://h5p.org/libraries/" + instance.libraryInfo.versionedNameNoSpaces,
|
||||
"objectType": "Activity"
|
||||
}
|
||||
];
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -748,6 +748,15 @@ H5P.newRunnable = function (library, contentId, $attachTo, skipResize, extras) {
|
|||
if (instance.parent === undefined && extras && extras.parent) {
|
||||
instance.parent = extras.parent;
|
||||
}
|
||||
if (instance.libraryInfo === undefined) {
|
||||
instance.libraryInfo = {
|
||||
versionedName: library.library,
|
||||
versionedNameNoSpaces: machineName + '-' + versionSplit[0] + '.' + versionSplit[1],
|
||||
machineName: machineName,
|
||||
majorVersion: versionSplit[0],
|
||||
minorVersion: versionSplit[1]
|
||||
};
|
||||
}
|
||||
|
||||
if ($attachTo !== undefined) {
|
||||
instance.attach($attachTo);
|
||||
|
|
Loading…
Reference in New Issue