From 059c386711f7fa736a45a56bd94499e9cb3bdb43 Mon Sep 17 00:00:00 2001 From: soufiane Date: Thu, 9 Nov 2023 17:11:24 +0100 Subject: [PATCH] wait #6467 @1:30 --- js/quiz.draganddrop.js | 5 +++++ js/quiz.score.js | 1 + style/001-global-variables.sass | 2 ++ style/106-question-draganddrop.sass | 13 +++++++------ 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/js/quiz.draganddrop.js b/js/quiz.draganddrop.js index 41551f6..cfe67e5 100644 --- a/js/quiz.draganddrop.js +++ b/js/quiz.draganddrop.js @@ -36,14 +36,19 @@ QuizDragAndDrop.prototype = { this.item = this.activeScreen.find(".list-item") this.zone1 = this.activeScreen.find(".zone-1 .zone-content") this.zone2 = this.activeScreen.find(".zone-2 .zone-content") + this.zonecontent = this.activeScreen.find(".zone-content") this.htmlZone1 = this.zone1.html() this.htmlZone2 = this.zone2.html() this.offsetLeftItemDragged = 0 this.offsetRightItemDragged = 0 this.initQuestion(); + + let height_ = 400 - $(".card-holder").parent().find(".text").height() + document.documentElement.style.setProperty('--height-zone', height_+'px'); }, + sendCurrentAnswerToArea: function (area, index) { if (this.animating === true) { return; diff --git a/js/quiz.score.js b/js/quiz.score.js index 1437203..21571d6 100644 --- a/js/quiz.score.js +++ b/js/quiz.score.js @@ -97,6 +97,7 @@ QuizScore.prototype = { this_score = 0; for (let answerIndex in question.answers) { const answer = question.answers[answerIndex]; + console.log("answer.drop_area",answer.drop_area,"userAnswers[answerIndex]",userAnswers[answerIndex]) this_score += ((answer.drop_area === userAnswers[answerIndex]) ? 1 : 0); } ok = this_score >= min_score ? 'ok' : 'nok'; diff --git a/style/001-global-variables.sass b/style/001-global-variables.sass index e69de29..861b960 100644 --- a/style/001-global-variables.sass +++ b/style/001-global-variables.sass @@ -0,0 +1,2 @@ +\:root + --height-zone: 0 diff --git a/style/106-question-draganddrop.sass b/style/106-question-draganddrop.sass index 0fb0a3a..adc4016 100644 --- a/style/106-question-draganddrop.sass +++ b/style/106-question-draganddrop.sass @@ -49,10 +49,10 @@ .zone-content position: absolute - top: 50% - transform: translateY(-50%) + bottom: 106px width: 180px - height: 50% + height: 400px + +flex-config(space-between,false,column,false) &.active .card-holder @@ -60,9 +60,9 @@ .card-holder - min-height: 196px - max-height: 303px overflow: hidden + height: var(--height-zone) + .m & display: none @@ -200,7 +200,8 @@ +opacity(.08, background-color, $texts-color) +radius(16px) padding: 8px - display: grid + display: flex + flex-direction: column gap: 8px .slot -- 2.39.5