]> _ Git - fluidbook-toolbox-quiz.git/commitdiff
wait #6321 @0:30
authorsoufiane <soufiane@cubedesigners.com>
Thu, 28 Sep 2023 15:39:33 +0000 (17:39 +0200)
committersoufiane <soufiane@cubedesigners.com>
Thu, 28 Sep 2023 15:39:33 +0000 (17:39 +0200)
js/quiz.screen.outro.js
views/screens/outro.blade.php

index 1026d33212774b77012ade98161598db5bacd8f0..ef09af81ff173cd4fb621c9881bc6e0d4bf8ccd9 100644 (file)
@@ -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()
+        }
     }
 };
 
index 0904563678f1f6abde7b0ab29872e6d4b8bb00ab..4101bde8cae3056deb19b1b6982d706be21421bd 100644 (file)
@@ -62,7 +62,7 @@
                         <span data-icon="search"></span>
                         <span>{{$__('Review answers')}}</span>
                     </a>
-                    <a class="btn primary action">
+                    <a id="leave-quiz" class="btn primary action">
                         <span>{{$__('Leave')}}</span>
                         <span class="access space">{{$__('space')}}</span>
                     </a>