From cdf259297eb5567aaf1dd383a9037e9a93928267 Mon Sep 17 00:00:00 2001 From: soufiane Date: Wed, 28 Feb 2024 18:54:23 +0100 Subject: [PATCH] wait #6758 @1:00 --- js/quiz.screen.outro.js | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/js/quiz.screen.outro.js b/js/quiz.screen.outro.js index 540dc46..5283d61 100644 --- a/js/quiz.screen.outro.js +++ b/js/quiz.screen.outro.js @@ -201,11 +201,6 @@ QuizScreenOutro.prototype = { } }, - 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())) { @@ -288,7 +283,7 @@ QuizScreenOutro.prototype = { nokClass = "nok" } html += '
'; - html += '

' + correctAnswers[j].answer +'

'; + html += '

' + correctAnswers[j].answer +'

'; html += htmlSpan; html += '
'; } @@ -317,7 +312,7 @@ QuizScreenOutro.prototype = { if (correctAnswers[k].status === "nok") { htmlSpan = `${wrongIcon}` } - html += '
  • ' + correctAnswers[k].answer + '

    ' + html += '
  • ' + correctAnswers[k].answer + '

    ' html += htmlSpan html += '
  • ' } @@ -346,9 +341,9 @@ QuizScreenOutro.prototype = { htmlSpan = `${wrongIcon}` } html += '
    ' - html += '

    ' + correctAnswers[k].answer + '

    ' + html += '

    ' + correctAnswers[k].answer + '

    ' html += htmlSpan !== "" ? htmlSpan : '
    ' - html += '

    ' + correctAnswers[k].proposition + '

    ' + html += '

    ' + correctAnswers[k].proposition + '

    ' html += '
    ' } } else { @@ -364,7 +359,18 @@ QuizScreenOutro.prototype = { // 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") + } + }) } + }; -- 2.39.5