From 01779c000468f90ad6e1d5189805029ba743e4eb Mon Sep 17 00:00:00 2001 From: Svein-Tore Griff With Date: Sun, 2 Nov 2014 21:16:19 +0100 Subject: [PATCH] Use score instead of points --- js/h5p.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js/h5p.js b/js/h5p.js index 1ce6024..c05c51d 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -158,10 +158,10 @@ H5P.xAPIListener = function(event) { console.log(event); if ('verb' in event.statement) { if (event.statement.verb.id === 'http://adlnet.gov/expapi/verbs/completed') { - var points = event.statement.result.score.raw; - var maxPoints = event.statement.result.score.max; + var score = event.statement.result.score.raw; + var maxScore = event.statement.result.score.max; var contentId = event.statement.object.contentId; - H5P.setFinished(contentId, points, maxPoints); + H5P.setFinished(contentId, score, maxScore); } } } @@ -1222,8 +1222,8 @@ H5P.setFinished = function (contentId, score, maxScore, time) { // TODO: Should we use a variable with the complete path? H5P.jQuery.post(H5P.ajaxPath + 'setFinished', { contentId: contentId, - points: score, - maxPoints: maxScore, + score: score, + maxScore: maxScore, opened: toUnix(H5P.opened[contentId]), finished: toUnix(new Date()), time: time