From e468096b28e1a332de0cf380c0de7bf8e75f31ca Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 2 Nov 2020 11:24:46 +0100 Subject: [PATCH] wait #4030 @0.5 --- resources/quiz/js/main.js | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) 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 { -- 2.39.5