From: soufiane Date: Tue, 8 Aug 2023 16:50:58 +0000 (+0200) Subject: wip #6182 @5:30 outro X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=d781b346b845ac436b7841bccd130cf02e07da7c;p=fluidbook-toolbox.git wip #6182 @5:30 outro --- diff --git a/resources/quizv2/js/quiz.js b/resources/quizv2/js/quiz.js index 6f20504f8..ea363b85f 100644 --- a/resources/quizv2/js/quiz.js +++ b/resources/quizv2/js/quiz.js @@ -131,6 +131,9 @@ Quiz.prototype = { }, next: function (responses) { + // on arrête l'animation si le joueur passe à la question suivante + this.stopAnimationValidation() + const $el = $(".active-screen .btn.action") let status = quiz.score.questionStatus @@ -192,7 +195,7 @@ Quiz.prototype = { }else { this.animationValidation("NOK") } - this.displayResult(validated.status[position].answers) + this.resultAfterValidation(validated.status[position].answers) } return false } @@ -213,7 +216,6 @@ Quiz.prototype = { if (questionStatus[lastAnsweredQuestion].ok === 'ok') { $_el.addClass("ok") } - if (questionStatus[lastAnsweredQuestion].ok === 'nok') { $_el.addClass("nok") } @@ -223,15 +225,19 @@ Quiz.prototype = { animationValidation: function(status) { let selector = $("#anim") let text = status === "NOK" ? "Not quite" : "Perfect" + let $this = this this.animations.load(status, selector, {'\\$text': text}); selector.addClass("active") - setTimeout(function(){ - selector.removeClass("active") - selector.empty() + setTimeout(function(e){ + $this.stopAnimationValidation() }, 10000) }, - displayResult: function(datas) { + stopAnimationValidation: () => { + $("#anim").removeClass("active").empty() + }, + + resultAfterValidation: function(datas) { for(let k in datas) { let n = (parseInt(k) + 1) let icon = getSpriteIcon("quiz-ok") @@ -244,6 +250,13 @@ Quiz.prototype = { $el.find(".access").addClass(datas[k]).html(icon) } } + }, + + result: function() { + let maxScore = quiz.score.maxScore, + score = quiz.score.score + + } } diff --git a/resources/views/quizv2/index.blade.php b/resources/views/quizv2/index.blade.php index 320473fb1..a01d88afd 100644 --- a/resources/views/quizv2/index.blade.php +++ b/resources/views/quizv2/index.blade.php @@ -23,6 +23,7 @@ @foreach($data->questions as $key => $question) @include('quizv2.screens.question_'.$question['type'], ['theme' => $data->theme, 'data'=> $question, 'max' => $totalQuestion, 'position' => $key, 'alphabet' => $alphabet]) @endforeach + @include('quizv2.screens.outro', ['data'=> $data])
diff --git a/resources/views/quizv2/screens/outro.blade.php b/resources/views/quizv2/screens/outro.blade.php new file mode 100644 index 000000000..6d8dc98fe --- /dev/null +++ b/resources/views/quizv2/screens/outro.blade.php @@ -0,0 +1,35 @@ +
+ @include('quizv2.header_title', ['data', $data]) +
+
+
+
+ / +
+
+
+

Congratulation!

+

You have completed the quiz with + correct answers out of

+
+
+
Want to improve your score?
+ +
+
+

Answers review

+

+
    +
+
+
+