From 8643158a02bf6403438f796d02761d7c0f31a206 Mon Sep 17 00:00:00 2001 From: soufiane Date: Thu, 28 Sep 2023 17:39:33 +0200 Subject: [PATCH] wait #6321 @0:30 --- js/quiz.screen.outro.js | 17 ++++++++++++++--- views/screens/outro.blade.php | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/js/quiz.screen.outro.js b/js/quiz.screen.outro.js index 1026d33..ef09af8 100644 --- a/js/quiz.screen.outro.js +++ b/js/quiz.screen.outro.js @@ -14,8 +14,6 @@ function QuizScreenOutro(screens) { QuizScreenOutro.prototype = { initEvents: function () { - this.animOk = false - $(document).on("click", ".toggle-answers-review", function () { $(".score-answers-review_container").toggleClass("active") }) @@ -25,7 +23,6 @@ QuizScreenOutro.prototype = { //animer le texte d'intro gsap.registerPlugin(DrawSVGPlugin); let subtitle = new SplitType(".score-text .subtitle", {types: 'words, chars'}) - const $this = this gsap.to(".active-screen #progress-circle", {drawSVG: 0, duration: 0}) gsap.timeline({delay: .4}) @@ -88,6 +85,9 @@ QuizScreenOutro.prototype = { const counter = $("#progress-counter") + // + this.checkScorm() + if (score < (maxScore / 2)) { counter.addClass("nok") } else if (score >= (maxScore / 2)) { @@ -139,6 +139,17 @@ QuizScreenOutro.prototype = { animationOk: function() { this.quiz.animations.load("CONFETTI", "#anime-ok", '', false); + }, + + checkScorm: function() { + const $this = this + if (this.quiz.scorm.enabled === true) { + $(document).on("click", "#leave-quiz", function () { + $this.quiz.scorm.quit() + }) + } else { + $("#leave-quiz").hide() + } } }; diff --git a/views/screens/outro.blade.php b/views/screens/outro.blade.php index 0904563..4101bde 100644 --- a/views/screens/outro.blade.php +++ b/views/screens/outro.blade.php @@ -62,7 +62,7 @@ {{$__('Review answers')}} - + {{$__('Leave')}} {{$__('space')}} -- 2.39.5