]> _ Git - fluidbook-toolbox-quiz.git/commitdiff
wait #6556 @0:20
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 6 Dec 2023 10:37:07 +0000 (11:37 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 6 Dec 2023 10:37:07 +0000 (11:37 +0100)
js/quiz.screen.outro.js

index 6ede3cd8291fb0c6b0d690d8079337e72e3d24a3..024b6523d52b85f326bf738032c20c52e245fca1 100644 (file)
@@ -22,7 +22,7 @@ QuizScreenOutro.prototype = {
         $(document).on('click', '.btn.restart', function () {
             $this.quiz.restart();
         });
-        $(document).on("mouseover", ".area-item", function() {
+        $(document).on("mouseover", ".area-item", function () {
             let quiz = $("#quiz").get(0)
             let x = (($(this).offset().left + $(this).width()) - quiz.getBoundingClientRect().x),
                 y = (($(this).offset().top - $(this).height()) - quiz.getBoundingClientRect().y) - $(this).height()
@@ -32,9 +32,9 @@ QuizScreenOutro.prototype = {
                 left: x,
                 top: y,
             })
-            gsap.to(popup, { autoAlpha: 1 })
-        }).on("mouseout", function() {
-            gsap.to(popup, { autoAlpha: 0 })
+            gsap.to(popup, {autoAlpha: 1})
+        }).on("mouseout", function () {
+            gsap.to(popup, {autoAlpha: 0})
         })
     },
 
@@ -188,9 +188,11 @@ QuizScreenOutro.prototype = {
 
     displayReviewList: function () {
         let $ul = $("#answers-list");
-        if ($ul.length === 0) {
+        if ($ul.length === 0 || this.quiz.data.review === 'never' || (this.quiz.data.review === 'passed' && !this.quiz.score.isPassed())) {
+            $(".score-answers-review_container").hide();
             return;
         }
+        $(".score-answers-review_container").show();
         let reviewList = this.quiz.question.getAll();
         let status = this.quiz.score.questionStatus
 
@@ -212,8 +214,6 @@ QuizScreenOutro.prototype = {
 
             let correctAnswers = review.correctAnswers.length > 0 ? review.correctAnswers : review.data.answers
 
-            console.log("review", review)
-            console.log("correctAnswers", correctAnswers)
 
             let titleType = '';
             if (review.type === "draganddrop") {