Skip to content

Commit

Permalink
Add existence check to completion-threshold extension
Browse files Browse the repository at this point in the history
  • Loading branch information
figureone committed May 25, 2018
1 parent 85b0b86 commit ef6d166
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/x-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,10 @@ H5P.VideoXAPI = (function ($) {
if (typeof volume !== 'undefined') {
extensions['https://w3id.org/xapi/video/extensions/volume'] = volume;
}
extensions['https://w3id.org/xapi/video/extensions/completion-threshold'] = instance.finishedThreshold;
if (typeof instance.finishedThreshold !== 'undefined') {
extensions['https://w3id.org/xapi/video/extensions/completion-threshold'] = instance.finishedThreshold;
}

return self.getArgsXAPI({
verb: 'http://adlnet.gov/expapi/verbs/initialized',
extensionsContext: extensions
Expand Down

0 comments on commit ef6d166

Please sign in to comment.