From 2a0f21b31becac7dda2d8854210df1474d4627c0 Mon Sep 17 00:00:00 2001 From: Oliver Tacke Date: Sat, 19 Oct 2024 12:05:49 +0200 Subject: [PATCH] HFP-4137 Add completiion/succes flags --- js/summary.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/summary.js b/js/summary.js index 9ed28c7..78eb0a8 100644 --- a/js/summary.js +++ b/js/summary.js @@ -391,7 +391,9 @@ H5P.Summary = (function ($, Question, XApiEventBuilder, StopWatch) { // Trigger overall answered xAPI event when finished if (finished) { - that.triggerXAPIScored(that.getScore(), that.getMaxScore(), 'answered'); + that.triggerXAPIScored( + that.getScore(), that.getMaxScore(), 'answered', true, that.getScore() === that.getMaxScore() + ); } }; @@ -795,6 +797,8 @@ H5P.Summary = (function ($, Question, XApiEventBuilder, StopWatch) { var result = XApiEventBuilder.createResult() .response(userAnswer.join('[,]')) .duration(duration) + .completion(true) + .success(self.correctOnFirstTry(userAnswer)) .score((self.correctOnFirstTry(userAnswer) ? 1 : 0), 1) .build(); @@ -833,6 +837,8 @@ H5P.Summary = (function ($, Question, XApiEventBuilder, StopWatch) { var result = XApiEventBuilder.createResult() .score(self.getScore(), self.getMaxScore()) .duration(self.getTotalPassedTime()) + .completion(true) + .success(self.getScore() === self.getMaxScore()) .build(); // creates the definition object