From: Vincent Vanwaelscappel Date: Mon, 3 May 2021 16:18:18 +0000 (+0200) Subject: wait #4402 @3 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=cbce742de231b635cc60c5613ebc808afe93b49e;p=Animations.git wait #4402 @3 --- diff --git a/RedbullWingfinder/p7-quiz/index.html b/RedbullWingfinder/p7-quiz/index.html index 5002dc0..4e188fd 100644 --- a/RedbullWingfinder/p7-quiz/index.html +++ b/RedbullWingfinder/p7-quiz/index.html @@ -39,6 +39,13 @@ opacity: 1; } + #questions img#qagree { + top: 139px; + left: 248px; + width: 41px; + height: auto; + } + #questions .next, #questions .prev, #questions .retake { position: absolute; cursor: pointer; @@ -243,6 +250,7 @@ +
@@ -287,6 +295,8 @@ $(document).on('click', '.retake', function () { answers = {}; + parent.fluidbook.cache.set('rb_wingfinder_enabled_sections', []); + showResultsFromStorage(); showQuestion(1, false); }); showResultsFromStorage(); @@ -298,8 +308,9 @@ answers[currentQuestion] = $("#answer").val(); } currentQuestion = q; - $('img.visible').removeClass('visible'); + $('img.visible').not('#qagree').removeClass('visible'); $('#q' + q).addClass('visible'); + $("#qagree").addClass('visible'); if (q <= 11) { $("#answer").attr('step', 0.5).val(0.5).show(); } else { @@ -307,6 +318,7 @@ } if (q == 12) { + $("#qagree").removeClass('visible'); showResults(); } } @@ -321,27 +333,36 @@ } function showResults() { - var strongs = 0; var matchesInverted = [1, 3, 4, 6, 8, 9]; - var matches = []; + var strongs = []; + var greens = []; $.each(answers, function (k, v) { k = parseInt(k); v = parseInt(v); - if (v === -1 || v === 2) { - strongs++; - matches.push(k); - return; - } + var inverted = matchesInverted.indexOf(k) >= 0; - if (v <= 0 && inverted) { - matches.push(k); - } else if (v >= 1 && !inverted) { - matches.push(k); + + var green = inverted ? v <= 0 : v > 0; + var strong = v === -1 || v === 2; + + if (green) { + if (strong) { + strongs.push(k); + } else { + greens.push(k); + } } }); - if (strongs >= 2) { - matches = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]; + console.log('strongs', strongs); + console.log('greens', greens); + + var matches; + if (strongs.length >= 2) { + matches = strongs; + } else { + matches = strongs.concat(greens); } + console.log(matches); _showMatches(matches); try { parent.fluidbook.cache.set('rb_wingfinder_enabled_sections', matches); diff --git a/RedbullWingfinder/p7-quiz/p7-quiz.zip b/RedbullWingfinder/p7-quiz/p7-quiz.zip index e105f94..b554328 100644 Binary files a/RedbullWingfinder/p7-quiz/p7-quiz.zip and b/RedbullWingfinder/p7-quiz/p7-quiz.zip differ diff --git a/RedbullWingfinder/p7-quiz/qagree.svg b/RedbullWingfinder/p7-quiz/qagree.svg new file mode 100644 index 0000000..147ea23 --- /dev/null +++ b/RedbullWingfinder/p7-quiz/qagree.svg @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +