]> _ Git - fluidbook-toolbox-quiz.git/commitdiff
wait #6467 @1:30
authorsoufiane <soufiane@cubedesigners.com>
Thu, 9 Nov 2023 16:11:24 +0000 (17:11 +0100)
committersoufiane <soufiane@cubedesigners.com>
Thu, 9 Nov 2023 16:11:24 +0000 (17:11 +0100)
js/quiz.draganddrop.js
js/quiz.score.js
style/001-global-variables.sass
style/106-question-draganddrop.sass

index 41551f62e709234db182f2380dc466f080c0a766..cfe67e5c8edd404d856ffa583605d1dc47e79e5a 100644 (file)
@@ -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;
index 143720353e00675989544cc4b1b1fc928698dc14..21571d612d0fbceb47061bbf8953a9c163d123f1 100644 (file)
@@ -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';
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..861b960f43ea4767bfc00c9c2c57484840ed2731 100644 (file)
@@ -0,0 +1,2 @@
+\:root
+    --height-zone: 0
index 0fb0a3a0d1b4112a33a3385bd975a9e6ce9e2cbd..adc4016c68494e329645430ccf5fbc23d19fb478 100644 (file)
 
         .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
     +opacity(.08, background-color, $texts-color)
     +radius(16px)
     padding: 8px
-    display: grid
+    display: flex
+    flex-direction: column
     gap: 8px
 
     .slot