Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HFP-4137 Add completion/succes flags #82

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion js/summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
);
}
};

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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
Expand Down