}
},
- returnContentClass: function(str = "", type = "") {
- let maxLength = type === "multiple" ? 200 : type === "draganddrop" ? 75 : 85
- return str.length >= maxLength ? "content" : ""
- },
-
displayReviewList: function () {
let $ul = $("#answers-list");
if ($ul.length === 0 || this.quiz.data.review === 'never' || (this.quiz.data.review === 'passed' && !this.quiz.score.isPassed())) {
nokClass = "nok"
}
html += '<div class="card-holder multiple-item slot ' + nokClass +'" data-tooltip="'+correctAnswers[j].answer+'">';
- html += '<p class="answer ' + this.returnContentClass(correctAnswers[j].answer,"multiple")+'">' + correctAnswers[j].answer +'</p>';
+ html += '<p class="answer">' + correctAnswers[j].answer +'</p>';
html += htmlSpan;
html += '</div>';
}
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 += '<li class="area-item slot active ' + correctAnswers[k].status + '"><p>' + correctAnswers[k].answer + '</p>'
html += htmlSpan
html += '</li>'
}
htmlSpan = `<span class="access nok">${wrongIcon}</span>`
}
html += '<div class="match-wrapper card-holder">'
- html += '<div class="match-item slot active ' + statusByAnswer.answers[k] + '" data-tooltip="'+correctAnswers[k].answer+'"><p class="'+this.returnContentClass(correctAnswers[k].answer)+'">' + correctAnswers[k].answer + '</p></div>'
+ html += '<div class="match-item slot active ' + statusByAnswer.answers[k] + '" data-tooltip="'+correctAnswers[k].answer+'"><p>' + correctAnswers[k].answer + '</p></div>'
html += htmlSpan !== "" ? htmlSpan : '<div class="separate"></div>'
- 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 class="match-item slot active ' + statusByAnswer.answers[k] + '" data-tooltip="'+correctAnswers[k].proposition+'"><p>' + correctAnswers[k].proposition + '</p></div>'
html += '</div>'
}
} else {
// mise en place de la scrollbar personnalisé
// https://github.com/Grsmto/simplebar/tree/master/packages/simplebar
const simpleBar = new SimpleBar($ul.get(0))
+ this.addClassContent();
+ },
+
+ addClassContent: function() {
+ $(".area-item,.match-item,.multiple-item").each(function() {
+ let p = $(this).find("p")
+ if(p.get(0).scrollHeight > p.get(0).clientHeight) {
+ p.addClass("content")
+ }
+ })
}
+
};