Skip to content

Commit

Permalink
Add grade and completion to final xapi data fixes h5p#56
Browse files Browse the repository at this point in the history
  • Loading branch information
dthies committed Aug 6, 2021
1 parent dea74b7 commit 58630e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"author": "Joubel",
"majorVersion": 1,
"minorVersion": 11,
"patchVersion": 14,
"patchVersion": 15,
"runnable": 1,
"fullscreen": 0,
"embedTypes": [
Expand Down
2 changes: 2 additions & 0 deletions scripts/single-choice-set.js
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,8 @@ H5P.SingleChoiceSet = (function ($, UI, Question, SingleChoice, SolutionView, Re
var result = XApiEventBuilder.createResult()
.score(self.getScore(), self.getMaxScore())
.duration(self.getTotalPassedTime())
.completion(true)
.success((100 * self.getScore() / self.options.choices.length) >= self.options.behaviour.passPercentage)
.build();

// creates the definition object
Expand Down

0 comments on commit 58630e4

Please sign in to comment.