Skip to content

Commit f894d76

Browse files
committed
HFP-3073 Fix updating score for every xAPI event subcontent sends
1 parent 3367101 commit f894d76

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/scripts/interaction.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,6 +1444,14 @@ function Interaction(parameters, player, previousState) {
14441444
return parent.id === interactiveVideoId;
14451445
});
14461446

1447+
// Update scores on any action, overwrite with event score if it exists
1448+
if (instance.getScore) {
1449+
self.score = instance.getScore();
1450+
}
1451+
if (instance.getMaxScore) {
1452+
self.maxScore = instance.getMaxScore();
1453+
}
1454+
14471455
if (isInteractiveVideoParent && isCompletedOrAnswered && event.getMaxScore()) {
14481456
// Allow subcontent types to have null scores so that they can be dynamically graded
14491457
// See H5P.FreeTextQuestion

0 commit comments

Comments
 (0)