Use score instead of points

namespaces
Svein-Tore Griff With 2014-11-02 21:16:19 +01:00
parent 658db52f89
commit 01779c0004
1 changed files with 5 additions and 5 deletions

View File

@ -158,10 +158,10 @@ H5P.xAPIListener = function(event) {
console.log(event); console.log(event);
if ('verb' in event.statement) { if ('verb' in event.statement) {
if (event.statement.verb.id === 'http://adlnet.gov/expapi/verbs/completed') { if (event.statement.verb.id === 'http://adlnet.gov/expapi/verbs/completed') {
var points = event.statement.result.score.raw; var score = event.statement.result.score.raw;
var maxPoints = event.statement.result.score.max; var maxScore = event.statement.result.score.max;
var contentId = event.statement.object.contentId; 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? // TODO: Should we use a variable with the complete path?
H5P.jQuery.post(H5P.ajaxPath + 'setFinished', { H5P.jQuery.post(H5P.ajaxPath + 'setFinished', {
contentId: contentId, contentId: contentId,
points: score, score: score,
maxPoints: maxScore, maxScore: maxScore,
opened: toUnix(H5P.opened[contentId]), opened: toUnix(H5P.opened[contentId]),
finished: toUnix(new Date()), finished: toUnix(new Date()),
time: time time: time