]> _ Git - fluidbook-toolbox-quiz.git/commitdiff
wip #6593 @4:00
authorsoufiane <soufiane@cubedesigners.com>
Fri, 19 Jan 2024 14:37:24 +0000 (15:37 +0100)
committersoufiane <soufiane@cubedesigners.com>
Fri, 19 Jan 2024 14:37:24 +0000 (15:37 +0100)
js/quiz.screen.outro.js
style/100-global.sass
style/105-outro.sass

index cf671be3c6483799be18a67b8da7d42caa116ba6..cd5a39c36e99ad33391092a4d2305ad2d59bc1ee 100644 (file)
@@ -205,6 +205,8 @@ QuizScreenOutro.prototype = {
         let answersUser = this.quiz.score.answers;
         let wrongIcon = getSpriteIcon("quiz-wrong");
 
+        console.log("score",this.quiz.score)
+
         reviewList = reviewList.map((c, i) => {
             return {
                 'question': c['question'],
@@ -212,20 +214,22 @@ QuizScreenOutro.prototype = {
                 'correctAnswers': c['answers'].filter((c__,k) => {
                     let status_ = c['answers']
                     if(c['type'] === "multiple") {
-                        status_ = c['answers'][k].correct === 1;
+                        status_ = parseInt(c['answers'][k].correct) === 1;
                     }
                     if(!quiz.score.isPassed()) {
                         status_ = status[i].answers[k] !== "missed" && status[i].answers[k] !== "neutral"
                     }
                     return status_
                 }).map((c_,k_) => {
-                    c_ = { ...c_ }; //shallow copy
                     if(c['type'] === "draganddrop" && !quiz.score.isPassed()) {
+                        c_ = { ...c_ }; //shallow copy
                         c_['drop_area'] = answersUser[i][k_]
                     }
-                    if(c['type'] === "match") {
+                    if(c['type'] === "match" && !quiz.score.isPassed()) {
+                        c_ = { ...c_ }; //shallow copy
                         c_['proposition'] = c['answers'][answersUser[i][k_]]['proposition']
                     }
+                    console.log(status[i].answers[k_])
                     c_['status'] = status[i].answers[k_]
                     return c_
                 }),
@@ -242,6 +246,8 @@ QuizScreenOutro.prototype = {
             let statusByAnswer = status[i]
             let nokClass = ""
 
+            console.log(review)
+
             let correctAnswers = review.correctAnswers.length > 0 ? review.correctAnswers : review.data.answers
 
             let titleType = '';
@@ -257,12 +263,13 @@ QuizScreenOutro.prototype = {
                 html += '<p class="question title-block">' + review.question + '</p>';
                 html += '<div class="multiple-wrapper">'
                 for (var j in correctAnswers) {
+                    nokClass = ""
                     if(correctAnswers[j].status === "nok" || correctAnswers[j].status === "missed") {
                         htmlSpan = `<span class="access nok">${wrongIcon}</span>`
                         nokClass = "nok"
                     }
                     html += '<div class="card-holder">';
-                    html += '<p class="answer slot active '+nokClass+'">' + correctAnswers[j].answer+htmlSpan+'</p>';
+                    html += '<p class="answer slot '+nokClass+'">' + correctAnswers[j].answer+htmlSpan+'</p>';
                     html += '</div>';
                 }
                 html += '</div>'
index 882cd4857e527a94e12b7fc89580882bdf8b1407..7502293c5e614d49ec304925e42d410c217d85d7 100644 (file)
@@ -265,7 +265,7 @@ body
 
     &.simplebar-vertical
         .simplebar-scrollbar::before
-            background-color: $accent-color
+            background-color: +opacity(.32, background-color, $texts-color)
             opacity: 1 !important
             width: 3px
             top: 1px
index 5c7c8b661bcf67b33a7b9ab3eb2c8eae23f0e303..ebc1cbcbb9b9ce88e3ea05e27f7bbbbdbf54ec09 100644 (file)
@@ -34,6 +34,7 @@
         h1
             +font-size(40)
             margin-bottom: 9px
+            line-height: normal
 
         .subtitle
             +font-size(16)
 
         & > .score-text
             text-align: center
-            margin-top: 22px
+            margin-top: 51px
+
+            .m &
+                margin-top: 22px
 
         &.neutral
             .score-text
 
     &-counter
         height: 0
-        padding-bottom: 43%
+        padding-bottom: 35%
         width: 43%
-        max-width: 210px
+        max-width: 140px
         position: relative
-        +font-size(80)
-        //margin-right: 60px
+        +font-size(56)
         flex-shrink: 0
 
         &.large-nbr
             background: transparent
             +flex-config(center, false, false, center)
 
+            &:after
+                content: ""
+                position: absolute
+                +opacity(.08,background-color,$neutral-color)
+                width: 130%
+                height: 130%
+                border-radius: 100%
+                z-index: -1
+
             svg
                 overflow: visible
                 width: 100%
                     stroke-width: 8px
 
                 circle:not(#progress-circle)
-                    +opacity(.08, color, $texts-color)
+                    +opacity(.16, color, $texts-color)
 
                 #overlay-circle
                     display: none
         padding: 24px 24px 0
         position: relative
 
+        .slot
+            &.active
+                background-color: $neutral-color !important
+            &.nok
+                border: 1px solid $nok-color
+
+        .quiz-wrong
+            color: $neutral-color
+
         h2
             +font-size(24)
             margin-bottom: 5px
             width: 5px
 
     #anime-result
-        transform: scale(1.7)
+        transform: scale(1.8)
 
     .area-container
         display: grid
             width: 100%
 
     .area-list
-        display: grid
+        display: flex
         gap: 8px
         height: 100%