]> _ Git - fluidbook-toolbox-quiz.git/commitdiff
wait #6927
authorsoufiane <soufiane@cubedesigners.com>
Thu, 23 May 2024 08:57:20 +0000 (10:57 +0200)
committersoufiane <soufiane@cubedesigners.com>
Thu, 23 May 2024 08:57:20 +0000 (10:57 +0200)
js/quiz.screens.js

index 0f65edcf91e6936febeed3344c9ba0eee634e9b0..32f10790e34f701a6235fb7fa46a10d9392690b4 100644 (file)
@@ -35,6 +35,8 @@ QuizScreens.prototype = {
 
         // enabled click on item
         $(".list-item").css("pointer-events","auto").find('label').css("background-color",standardColor)
+        this.updateTabindexToQuestionMultiple();
+
 
         // RĂ©initialiser les rĂ©ponses
         $(document).on("click", ".btn.reset", function (e) {
@@ -195,7 +197,6 @@ QuizScreens.prototype = {
             $this.resetForm();
             $this.currentQuestionAnswers = [];
             $this.quiz.progressbar.update();
-            $this.updateTabindexToQuestionMultiple();
 
             if (screen === 'outro') {
                 $this.outro.initEvents();
@@ -356,14 +357,11 @@ QuizScreens.prototype = {
     },
 
     updateTabindexToQuestionMultiple: function() {
-        if(this.getActiveScreenType() === "multiple") {
-            $(".list-item").removeAttr("tabindex")
-            let counter = 0;
-            this.activeScreen.find(".list-item").each(function(index) {
-                counter++
-                $(this).attr('tabindex', counter)
-            })
-        }
+        let counter = 0;
+        $(".question-multiple .list-item").each(function() {
+            counter++
+            $(this).attr('tabindex', counter)
+        })
     }
 };