]> _ Git - fluidbook-toolbox.git/commitdiff
wait #4030 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 2 Nov 2020 10:24:46 +0000 (11:24 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 2 Nov 2020 10:24:46 +0000 (11:24 +0100)
resources/quiz/js/main.js

index 805518a959876c01ae2693bfcdc4fcee306908ab..33009996d4d1bf78c1951ce7acab92939bc28166 100644 (file)
                     return;
                 }
             }
-            var ok = true;
-            $(question).find('.answer').each(function () {
-                if (($(this).attr('data-correct') == '1') != $(this).hasClass('active')) {
-                    ok = false;
-                    return false;
-                }
-            });
+            if ($(question).attr('data-count') == '0') {
+                ok = null;
+            } else {
+                var ok = true;
+                $(question).find('.answer').each(function () {
+                    if (($(this).attr('data-correct') == '1') != $(this).hasClass('active')) {
+                        ok = false;
+                        return false;
+                    }
+                });
+            }
             updateScore();
             displayBadge(ok);
             resizeContainer();
 
             var passed = checkScore();
             if (logAttempts) {
-               logAttempt(passed);
+                logAttempt(passed);
             }
         }
 
-        function logAttempt(passed){
+        function logAttempt(passed) {
             var logdata = {
                 passed: passed,
                 score: Math.round(100 * (score / countQuestions)),
                 nextScreen();
                 return;
             }
+            if (correct === null) {
+                nextScreen();
+                return;
+            }
             if (correct) {
                 $("#badge").addClass('correct').removeClass('incorrect');
             } else {