Skip to content

Commit

Permalink
Merge pull request #188 from h5p/ji-2976-fix-completed-event-in-solut…
Browse files Browse the repository at this point in the history
…ion-mode

JI-2976 fix completed event in solution mode
  • Loading branch information
thomasmars authored Nov 8, 2021
2 parents 55812ce + 7f0921f commit fbd4d07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/scripts/cp.js
Original file line number Diff line number Diff line change
Expand Up @@ -1770,7 +1770,7 @@ CoursePresentation.prototype.processJumpToSlide = function (slideNumber, noScrol
}).removeClass('h5p-touch-move').removeClass('h5p-previous');
$prevs.addClass('h5p-previous');
that.$current.addClass('h5p-current');

// Set tabindex for better accessibility if there are no interactions
if (typeof that.slidesWithSolutions[that.getCurrentSlideIndex()] === 'undefined') {
that.$current.find('.h5p-element-inner').attr('tabindex', '0');
Expand Down
4 changes: 3 additions & 1 deletion src/scripts/summary-slide.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ const SummarySlide = (function () {
totalMaxScore += slideScores[i].maxScore;
}

that.cp.triggerXAPICompleted(totalScore, totalMaxScore);
if (!this.cp.isSolutionMode) {
that.cp.triggerXAPICompleted(totalScore, totalMaxScore);
}
var shareResultContainer = (that.cp.enableTwitterShare || that.cp.enableFacebookShare || that.cp.enableGoogleShare) ? '<span class="h5p-show-results-text">' + that.cp.l10n.shareResult + '</span>' : '';
var twitterContainer = (that.cp.enableTwitterShare == true) ? '<span class="h5p-summary-twitter-message" aria-label="' + that.cp.l10n.shareTwitter + '"></span>': '';
var facebookContainer = (that.cp.enableFacebookShare == true) ? '<span class="h5p-summary-facebook-message" aria-label="' + that.cp.l10n.shareFacebook + '"></span>': '';
Expand Down

0 comments on commit fbd4d07

Please sign in to comment.