From: soufiane Date: Fri, 11 Aug 2023 10:18:28 +0000 (+0200) Subject: wip #6182 @0:20 (correction bug) renvoyer une réponse vide lorsque le joueur valide... X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=f724885a8c302d3fba47905ac438188366de97b0;p=fluidbook-toolbox.git wip #6182 @0:20 (correction bug) renvoyer une réponse vide lorsque le joueur valide sans choisir de réponse --- diff --git a/resources/quizv2/js/quiz.js b/resources/quizv2/js/quiz.js index dd28bfd07..90957606e 100644 --- a/resources/quizv2/js/quiz.js +++ b/resources/quizv2/js/quiz.js @@ -98,6 +98,7 @@ Quiz.prototype = { $(document).on("click", ".next .action", function () { let responses = $this.responses $this.next(responses); + $this.responses = [] }) key('space', function (e){ e.preventDefault() @@ -110,7 +111,6 @@ Quiz.prototype = { }) key('r', function (e){ e.preventDefault() - console.log(e) $this.resetForm() }) @@ -185,14 +185,15 @@ Quiz.prototype = { } }, - // + // marque page automatique + // si le joueur recharge la page, le rediriger là où il en était setDisplay: function() { const currentQuestion = quiz.score.lastAnsweredQuestion + 1, questions = this.quiz.questions if(questions.length > 0) { if (quiz.score.lastAnsweredQuestion > -1 && questions.length <= currentQuestion) { - + // } } }, @@ -290,6 +291,13 @@ Quiz.prototype = { let status = quiz.score.questionStatus let reviewList = this.question.getAll(); + const counter = $("#progress-counter") + if(score < (maxScore / 2)) { + counter.addClass("nok") + }else if(score >= (maxScore / 2)) { + counter.addClass("ok") + } + reviewList = reviewList.map((c,i) => { return { 'question': c['question'], @@ -304,9 +312,15 @@ Quiz.prototype = { $("[id^=score-]").text(score) $("[id^=maxScore-]").text(maxScore) + // + // HANDLEBARS TEMPLATING + // + // on applique une incrementation de +1 + // utilisé pour la numérotation des questions Handlebars.registerHelper("inc", (value) => { return parseInt(value) + 1; }); - const source = $("#template").html(); + // on envoie le html avec les nouvelles données + const source = $("#template-answers-review").html(); const template = Handlebars.compile(source); const html = template({reviewList: reviewList}); $ul.html(html) diff --git a/resources/quizv2/style/105-outro.sass b/resources/quizv2/style/105-outro.sass index 0b2e9da5f..0438c0ee8 100644 --- a/resources/quizv2/style/105-outro.sass +++ b/resources/quizv2/style/105-outro.sass @@ -42,6 +42,11 @@ border-radius: 100px background: transparent +flex-config(center,false,false,center) + &.nok * + color: $nok-color + &.ok * + color: $ok-color + svg overflow: visible width: calc(100% - 12px) @@ -53,7 +58,6 @@ circle:not(#progress-circle) +opacity(.16,color,$texts-color) circle#progress-circle - color: $ok-color transition: stroke-dashoffset 0.5s ease-in-out &-answers-review diff --git a/resources/views/quizv2/screens/outro.blade.php b/resources/views/quizv2/screens/outro.blade.php index e289f9042..d0b141677 100644 --- a/resources/views/quizv2/screens/outro.blade.php +++ b/resources/views/quizv2/screens/outro.blade.php @@ -5,7 +5,7 @@
- 0/0 + 0/0 @@ -37,7 +37,7 @@

Review your answers before you go

    @verbatim -