Don't require that the user removes the final description to trigger completed
https://www.drupal.org/node/2730223pull/10/head
parent
dea9e3cb8d
commit
c6b8ad44e4
|
@ -36,12 +36,15 @@ H5P.MemoryGame = (function (EventDispatcher, $) {
|
||||||
var finished = (removed === cards.length);
|
var finished = (removed === cards.length);
|
||||||
var desc = card.getDescription();
|
var desc = card.getDescription();
|
||||||
|
|
||||||
|
if (finished) {
|
||||||
|
self.triggerXAPIScored(1, 1, 'completed');
|
||||||
|
}
|
||||||
|
|
||||||
if (desc !== undefined) {
|
if (desc !== undefined) {
|
||||||
// Pause timer and show desciption.
|
// Pause timer and show desciption.
|
||||||
timer.stop();
|
timer.stop();
|
||||||
popup.show(desc, card.getImage(), function () {
|
popup.show(desc, card.getImage(), function () {
|
||||||
if (finished) {
|
if (finished) {
|
||||||
self.triggerXAPIScored(1, 1, 'completed');
|
|
||||||
// Game has finished
|
// Game has finished
|
||||||
$feedback.addClass('h5p-show');
|
$feedback.addClass('h5p-show');
|
||||||
}
|
}
|
||||||
|
@ -52,7 +55,6 @@ H5P.MemoryGame = (function (EventDispatcher, $) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else if (finished) {
|
else if (finished) {
|
||||||
self.triggerXAPIScored(1, 1, 'completed');
|
|
||||||
// Game has finished
|
// Game has finished
|
||||||
timer.stop();
|
timer.stop();
|
||||||
$feedback.addClass('h5p-show');
|
$feedback.addClass('h5p-show');
|
||||||
|
|
Loading…
Reference in New Issue