}
$(".score-answers-review_container").show();
let reviewList = this.quiz.question.getAll();
+ let reviewList2 = this.quiz.question.getAll();
let status = this.quiz.score.questionStatus
+ let answersUser = this.quiz.score.answers;
+ let wrongIcon = getSpriteIcon("quiz-wrong");
+
+ console.log("reviewList2",reviewList2)
reviewList = reviewList.map((c, i) => {
return {
'question': c['question'],
'type': c['type'],
- 'correctAnswers': c['answers'].filter((c) => {
- return c['correct'] === 1
+ 'correctAnswers': c['answers'].filter((c__,k) => {
+ let answers = answersUser[i][k]
+ if(c['type'] === "match") {
+ answers = c['answers'][answersUser[i][k]]
+ }else if(c['type'] === "multiple") {
+ console.log("index k",k,"index answersUser",answersUser[i][k])
+ answers = answersUser[i].includes(k)
+ }
+ return answers
+ }).map((c_,k_) => {
+ if(c['type'] === "draganddrop") {
+ c_['drop_area'] = answersUser[i][k_]
+ }
+ if(c['type'] === "match") {
+ c_ = { ...c_ }; //shallow copy
+ c_['proposition'] = c['answers'][answersUser[i][k_]]['proposition']
+ }
+ return c_
}),
'status': status[i].ok,
'data': c,
for (var i in reviewList) {
i = parseInt(i);
let review = reviewList[i];
+ let htmlSpan = null
- let correctAnswers = review.correctAnswers.length > 0 ? review.correctAnswers : review.data.answers
+ console.log("result",review)
+ let correctAnswers = review.correctAnswers.length > 0 ? review.correctAnswers : review.data.answers
let titleType = '';
if (review.type === "draganddrop") {
if (review.type === "multiple") {
html += '<p class="question">' + review.question + '</p>';
+ html += '<div class="multiple-wrapper">'
for (var j in correctAnswers) {
+ if(!parseInt(correctAnswers[j].correct)) {
+ htmlSpan = `<span class="access nok">${wrongIcon}</span>`
+ }
html += '<div class="card-holder">';
- html += '<p class="answer slot active">' + correctAnswers[j].answer + '</p>';
+ html += '<p class="answer slot active">' + correctAnswers[j].answer + htmlSpan +'</p>';
html += '</div>';
}
+ html += '</div>'
}
if (review.type === "draganddrop") {
for (let k in correctAnswers) {
html += '<div class="match-wrapper card-holder">'
html += '<div class="match-item slot active"><p>' + correctAnswers[k].answer + '</p></div>'
+ html += '<div class="separate"></div>'
html += '<div class="match-item slot active"><p>' + correctAnswers[k].proposition + '</p></div>'
html += '</div>'
}
top: var(--space-21-66)
//margin-left: 75px
+ & > .score-text
+ text-align: center
+ margin-top: 22px
+
&.neutral
.score-text
width: 100%
.score-text
transform: scale(0)
- &-text
- text-align: center
- margin-top: 22px
-
&-answers-review_container
width: 61.11111%
#anime-result
transform: scale(1.7)
- .area-container,
- .match-wrapper
+ .area-container
display: grid
grid-template-columns: 2fr 2fr
+
+ .area-container,
+ .match-wrapper
gap: 8px
.match-container
display: grid
gap: 8px
+ .match-wrapper
+ display: flex
+ align-items: center
+ flex-wrap: wrap
+ flex-direction: row
+
+ .multiple-wrapper
+ +flex-config(false,false,column)
+ .card-holder
+ padding: 0
+ background: transparent
+ .slot
+ +flex-config(space-between)
+ background-color: rgba($texts-color,.08) !important
+
.match-title,
.area-title
display: grid
background-color: $neutral-color !important
cursor: pointer
+ .match-item
+ flex: 1
+ border: 0
+
+ .separate
+ width: 32px
+ height: 2px
+ border-radius: 5px
+ +opacity(.24, background-color, $texts-color)
+
#resume
width: 100%
max-width: 300px