if (review.type === "draganddrop") {
nokClass = ""
- html += '<div class="area-title">'
- html += '<p class="title-block">' + review.data.area_1.title + '</p><p class="title-block">' + review.data.area_2.title + '</p>'
- html += '</div>'
- html += '<div class="area-container">'
-
- if(correctAnswers.filter( (n) => { return n['drop_area'] !== undefined } ).length === correctAnswers.length) {
+ if(answersUser[i].length === correctAnswers.length) {
+ html += '<div class="area-title">'
+ html += '<p class="title-block">' + review.data.area_1.title + '</p><p class="title-block">' + review.data.area_2.title + '</p>'
+ html += '</div>'
+ html += '<div class="area-container">'
for (let i = 1; i < 3; i++) {
let area = i === 1 ? review.data.area_1 : review.data.area_2
html += '<div class="area area ' + i + '">'
html += '<ul class="area-list card-holder">'
- if (correctAnswers.length > 0) {
- for (let k in correctAnswers) {
- if (correctAnswers[k].drop_area === i) {
- htmlSpan = ""
- if (correctAnswers[k].status === "nok") {
- htmlSpan = `<span class="access nok">${wrongIcon}</span>`
- }
- html += '<li class="area-item slot active ' + correctAnswers[k].status + '"><p class="' + this.returnContentClass(correctAnswers[k].answer, "draganddrop") + '">' + correctAnswers[k].answer + '</p>'
- html += htmlSpan
- html += '</li>'
+ for (let k in correctAnswers) {
+ if (correctAnswers[k].drop_area === i) {
+ htmlSpan = ""
+ if (correctAnswers[k].status === "nok") {
+ htmlSpan = `<span class="access nok">${wrongIcon}</span>`
}
+ html += '<li class="area-item slot active ' + correctAnswers[k].status + '"><p class="' + this.returnContentClass(correctAnswers[k].answer, "draganddrop") + '">' + correctAnswers[k].answer + '</p>'
+ html += htmlSpan
+ html += '</li>'
}
}
html += '</ul>'
html += '</div>'
}
+ html += '</div>'
+
} else {
html += '<p class="timeout">'+this.quiz.l10n.__("Failed because you didn't answer in time")+'</p>'
}
- html += '</div>'
}
if (review.type === "match") {
html += '<div class="match-container">'
- html += '<div class="match-title">'
- html += '<p class="title-block">' + this.quiz.l10n.__('Question') + '</p><p class="title-block">' + this.quiz.l10n.__('Answers') + '</p>'
- html += '</div>'
- if(correctAnswers.length > 0) {
+ if(answersUser[i].length === correctAnswers.length) {
+ html += '<div class="match-title">'
+ html += '<p class="title-block">' + this.quiz.l10n.__('Question') + '</p><p class="title-block">' + this.quiz.l10n.__('Answers') + '</p>'
+ html += '</div>'
+
for (let k in correctAnswers) {
htmlSpan = ""
if (statusByAnswer.answers[k] === "nok") {
html += '<div class="match-item slot active ' + statusByAnswer.answers[k] + '" data-tooltip="'+correctAnswers[k].proposition+'"><p class="'+this.returnContentClass(correctAnswers[k].proposition)+'">' + correctAnswers[k].proposition + '</p></div>'
html += '</div>'
}
+ } else {
+ html += '<p class="timeout">'+this.quiz.l10n.__("Failed because you didn't answer in time")+'</p>'
}
html += '</div>'
}