From: Vincent Vanwaelscappel Date: Mon, 2 Nov 2020 10:24:46 +0000 (+0100) Subject: wait #4030 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=e468096b28e1a332de0cf380c0de7bf8e75f31ca;p=fluidbook-toolbox.git wait #4030 @0.5 --- diff --git a/resources/quiz/js/main.js b/resources/quiz/js/main.js index 805518a95..33009996d 100644 --- a/resources/quiz/js/main.js +++ b/resources/quiz/js/main.js @@ -231,13 +231,17 @@ 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(); @@ -311,11 +315,11 @@ 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)), @@ -371,6 +375,10 @@ nextScreen(); return; } + if (correct === null) { + nextScreen(); + return; + } if (correct) { $("#badge").addClass('correct').removeClass('incorrect'); } else {