Added utility function for figuriong out if event is from child [HFP-436]
parent
2cc6c53da1
commit
738dced286
|
@ -248,6 +248,16 @@ H5P.XAPIEvent.prototype.getContentXAPIId = function (instance) {
|
||||||
return xAPIId;
|
return xAPIId;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if this event is sent from a child (i.e not from grandchild)
|
||||||
|
*
|
||||||
|
* @return {Boolean}
|
||||||
|
*/
|
||||||
|
H5P.XAPIEvent.prototype.isFromChild = function () {
|
||||||
|
var parentId = this.getVerifiedStatementValue(['context', 'contextActivities', 'parent', 0, 'id']);
|
||||||
|
return !parentId || parentId.indexOf('subContentId') === -1;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Figure out if a property exists in the statement and return it
|
* Figure out if a property exists in the statement and return it
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue