diff --git a/macao/assets/_custom.scss b/macao/assets/_custom.scss index 4f698309531e8fc1e0ffa9ae12b743039753b1c1..5162764b4668d3f397c6adee6f90fac42efcf38e 100644 --- a/macao/assets/_custom.scss +++ b/macao/assets/_custom.scss @@ -51,7 +51,7 @@ select.sd-dropdown.inline-dropdown, input.sd-input.inline-input { // *********************************** // Hide disabled checkboxes in some quizz // *********************************** -[data-name="pg665"] { +.hide-disabled-checkboxes { .sd-checkbox--readonly { span.sd-checkbox__decorator { display: none; diff --git a/macao/assets/custom.js b/macao/assets/custom.js index 8aa55710a5d96edaf982483f153935da8a7474f6..034a11d137f24f0147d5b0361abb30acba83b02c 100644 --- a/macao/assets/custom.js +++ b/macao/assets/custom.js @@ -1,5 +1,6 @@ +console.log('Custom JS loaded'); $(document).ready(function() { - console.log('Custom JS loaded'); + console.log('Custom JS executed'); // Add specific classes to play buttons $('button:contains("Play")').html('<i class="fa-solid fa-play"></i>'); }); diff --git a/macao/assets/quiz.js b/macao/assets/quiz.js index 8ca6271c1809e88b60d6c8c689a92c62439f559e..1690efe5d996ea8ad5a0ebd0ec5d5f0b38db3920 100644 --- a/macao/assets/quiz.js +++ b/macao/assets/quiz.js @@ -1,7 +1,7 @@ /** * Checks whether all questions are correctly answered and displays the overall feedback. */ -function checkAllQuestions(questions, surveyConfig) { +function checkAllQuestions(questions, surveyConfig, converter) { let allCorrect = true; questions.forEach((question) => { @@ -12,10 +12,10 @@ function checkAllQuestions(questions, surveyConfig) { if (allCorrect) { correctIndic.node.className = "correct"; - correctIndic.commentNode.innerHTML = surveyConfig.correctComment || "All answers are correct!"; + correctIndic.commentNode.innerHTML = converter.renderInline(surveyConfig.correctComment) || "All answers are correct!"; } else { correctIndic.node.className = "incorrect"; - correctIndic.commentNode.innerHTML = surveyConfig.incorrectComment || "Some answers are incorrect!"; + correctIndic.commentNode.innerHTML = converter.renderInline(surveyConfig.incorrectComment) || "Some answers are incorrect!"; } } @@ -63,8 +63,13 @@ $(function () { }); survey.onAfterRenderQuestion.add((survey, options) => { - if (options.question.customFormat && options.question.customFormat === "one_line") { - $(options.htmlElement).addClass("one-line"); + if (options.question.customFormat) { + if (options.question.customFormat === "one_line") { + $(options.htmlElement).addClass("one-line"); + } + if(options.question.customFormat === "hide_disabled-checkboxes") { + $(options.htmlElement).addClass("hide-disabled-checkboxes"); + } } }); @@ -74,7 +79,7 @@ $(function () { id: "sv-nav-check", title: "Vérifier", action: () => { - checkAllQuestions(survey.currentPage.questions, jsonStatic); + checkAllQuestions(survey.currentPage.questions, jsonStatic, converter); }, css: "nav-button", innerCss: "sd-btn sd-btn--action nav-input"