From: soufiane Date: Mon, 7 Aug 2023 10:36:56 +0000 (+0200) Subject: wip #6182 @1:30 gestion des status de réponses X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=fe929eb7568084c086debc82143db7de6e86f7f1;p=fluidbook-toolbox.git wip #6182 @1:30 gestion des status de réponses --- diff --git a/resources/quizv2/js/quiz.js b/resources/quizv2/js/quiz.js index 397076b7c..65731ed7d 100644 --- a/resources/quizv2/js/quiz.js +++ b/resources/quizv2/js/quiz.js @@ -188,9 +188,9 @@ Quiz.prototype = { for(let k in datas) { let n = (parseInt(k) + 1) let icon = getSpriteIcon("quiz-ok") - let $el = $(".active-screen .question-multiple .list-item:nth-of-type("+n+")") + let $el = $(".active-screen .question-multiple .list-item:nth-of-type("+n+") label") $el.addClass(datas[k]) - if(datas[k] !== "ok") { + if(datas[k] === "nok") { icon = getSpriteIcon("quiz-wrong") } if(datas[k] !== "neutral") { diff --git a/resources/quizv2/js/quiz.question.js b/resources/quizv2/js/quiz.question.js index b3a4460b8..ecc3cd1a0 100644 --- a/resources/quizv2/js/quiz.question.js +++ b/resources/quizv2/js/quiz.question.js @@ -8,7 +8,21 @@ QuizQuestion.prototype = { }, - getFormData: (responses) => { + getAll: function() { + return this.quiz.questions + }, + + byPosition: function(pos) { + return this.quiz.data.questions[parseInt(pos)] + }, + + current: function() { + let currentPosition = $(".active-screen").data("position"); + return this.byPosition(currentPosition) + }, + + getFormData: function(responses) { + // }, } diff --git a/resources/quizv2/style/100-global.sass b/resources/quizv2/style/100-global.sass index 4949f7cc5..32d616012 100644 --- a/resources/quizv2/style/100-global.sass +++ b/resources/quizv2/style/100-global.sass @@ -43,8 +43,7 @@ body max-width: 177px .access - width: 100% - max-width: 34px + width: 34px height: 34px border-radius: 4px +font-size(16) @@ -53,15 +52,24 @@ body margin-left: 16px +flex-config(center,false,false,center) &.space - max-width: 70px + width: 70px &.infos - max-width: 40px + width: 40px &.ok +opacity(.24, background-color, $ok-color) + + &.ok, + &.missed + svg + color: $ok-color &.nok +opacity(.24, background-color, $nok-color) + svg + color: $nok-color + &.ok, - &.nok + &.nok, + &.missed svg width: 15px height: 15px diff --git a/resources/quizv2/style/103-question-multiple.sass b/resources/quizv2/style/103-question-multiple.sass index 866041139..8ef46dc6b 100644 --- a/resources/quizv2/style/103-question-multiple.sass +++ b/resources/quizv2/style/103-question-multiple.sass @@ -24,6 +24,7 @@ // &.missed // + +opacity(.80,background-color,$neutral-color) * z-index: 1 @@ -37,3 +38,7 @@ position: absolute top: 0 left: 0 + &.nok:after + background: transparent + &.missed:after + +opacity(.24,background-color,$ok-color) diff --git a/resources/views/quizv2/index.blade.php b/resources/views/quizv2/index.blade.php index fb1fc5066..a2ff8a67d 100644 --- a/resources/views/quizv2/index.blade.php +++ b/resources/views/quizv2/index.blade.php @@ -23,7 +23,6 @@ @foreach($data->questions as $key => $question) @include('quizv2.screens.question_'.$question['type'], ['data'=> $question, 'max' => $totalQuestion, 'position' => $key, 'alphabet' => $alphabet]) @endforeach -