]> _ Git - fluidbook-toolbox-quiz.git/commitdiff
wait #6691 @0:30
authorsoufiane <soufiane@cubedesigners.com>
Mon, 29 Jan 2024 16:27:34 +0000 (17:27 +0100)
committersoufiane <soufiane@cubedesigners.com>
Mon, 29 Jan 2024 16:27:34 +0000 (17:27 +0100)
js/quiz.screen.outro.js
js/quiz.screens.js
style/105-outro.sass

index 4c53bd27a42b5f74ee2cf8fafb31caa80f2d942e..215b006abcc61372946ded3e80a2b32af9a6fc21 100644 (file)
@@ -295,45 +295,44 @@ QuizScreenOutro.prototype = {
 
             if (review.type === "draganddrop") {
                 nokClass = ""
-                html += '<div class="area-title">'
-                html += '<p class="title-block">' + review.data.area_1.title + '</p><p class="title-block">' + review.data.area_2.title + '</p>'
-                html += '</div>'
-                html += '<div class="area-container">'
-
-                if(correctAnswers.filter( (n) => { return n['drop_area'] !== undefined } ).length === correctAnswers.length) {
+                if(answersUser[i].length === correctAnswers.length) {
+                    html += '<div class="area-title">'
+                    html += '<p class="title-block">' + review.data.area_1.title + '</p><p class="title-block">' + review.data.area_2.title + '</p>'
+                    html += '</div>'
+                    html += '<div class="area-container">'
 
                     for (let i = 1; i < 3; i++) {
                         let area = i === 1 ? review.data.area_1 : review.data.area_2
                         html += '<div class="area area ' + i + '">'
                         html += '<ul class="area-list card-holder">'
-                        if (correctAnswers.length > 0) {
-                            for (let k in correctAnswers) {
-                                if (correctAnswers[k].drop_area === i) {
-                                    htmlSpan = ""
-                                    if (correctAnswers[k].status === "nok") {
-                                        htmlSpan = `<span class="access nok">${wrongIcon}</span>`
-                                    }
-                                    html += '<li class="area-item slot active ' + correctAnswers[k].status + '"><p class="' + this.returnContentClass(correctAnswers[k].answer, "draganddrop") + '">' + correctAnswers[k].answer + '</p>'
-                                    html += htmlSpan
-                                    html += '</li>'
+                        for (let k in correctAnswers) {
+                            if (correctAnswers[k].drop_area === i) {
+                                htmlSpan = ""
+                                if (correctAnswers[k].status === "nok") {
+                                    htmlSpan = `<span class="access nok">${wrongIcon}</span>`
                                 }
+                                html += '<li class="area-item slot active ' + correctAnswers[k].status + '"><p class="' + this.returnContentClass(correctAnswers[k].answer, "draganddrop") + '">' + correctAnswers[k].answer + '</p>'
+                                html += htmlSpan
+                                html += '</li>'
                             }
                         }
                         html += '</ul>'
                         html += '</div>'
                     }
+                    html += '</div>'
+
                 } else {
                     html += '<p class="timeout">'+this.quiz.l10n.__("Failed because you didn't answer in time")+'</p>'
                 }
-                html += '</div>'
             }
 
             if (review.type === "match") {
                 html += '<div class="match-container">'
-                html += '<div class="match-title">'
-                html += '<p class="title-block">' + this.quiz.l10n.__('Question') + '</p><p class="title-block">' + this.quiz.l10n.__('Answers') + '</p>'
-                html += '</div>'
-                if(correctAnswers.length > 0) {
+                if(answersUser[i].length === correctAnswers.length) {
+                    html += '<div class="match-title">'
+                    html += '<p class="title-block">' + this.quiz.l10n.__('Question') + '</p><p class="title-block">' + this.quiz.l10n.__('Answers') + '</p>'
+                    html += '</div>'
+
                     for (let k in correctAnswers) {
                         htmlSpan = ""
                         if (statusByAnswer.answers[k] === "nok") {
@@ -345,6 +344,8 @@ QuizScreenOutro.prototype = {
                         html += '<div class="match-item slot active ' + statusByAnswer.answers[k] + '" data-tooltip="'+correctAnswers[k].proposition+'"><p class="'+this.returnContentClass(correctAnswers[k].proposition)+'">' + correctAnswers[k].proposition + '</p></div>'
                         html += '</div>'
                     }
+                } else {
+                    html += '<p class="timeout">'+this.quiz.l10n.__("Failed because you didn't answer in time")+'</p>'
                 }
                 html += '</div>'
             }
index 53e2b8bde72aa90958fe14e8005dc6c788c47456..9fb995e4a6bd5c9bfa1d6b0422a5ea31fe179346 100644 (file)
@@ -62,7 +62,7 @@ QuizScreens.prototype = {
             }
 
             if(($this.getActiveScreenType() === 'draganddrop' && $this.activeScreen.find(".list-item").length > 0)
-                && (parseInt($this.quiz.question.current().countdown_enable) && $this.intervalCountDown !== 0)) {
+                && (parseInt($this.quiz.question.current().countdown_enable) && $this.intervalCountDown > 0)) {
                 return false;
             }
 
index 5a68723a99c782d8dac5035d2a531dbd5f15f32a..c1d9b6475ae78c6f8ea0c7b196912c1fbe69f4d4 100644 (file)
         border-radius: 5px
         +opacity(.24, background-color, $texts-color)
 
+    .timeout
+        margin-top: 8px
+
 #resume
     width: 100%
     max-width: 300px