Skip to content
Snippets Groups Projects
Commit 2293b83c authored by Anthony's avatar Anthony
Browse files

Convert Markdown to HTML in feedback

parent a86a3ad5
Branches
No related tags found
1 merge request!3Resolve "Implémentation types d'exercice manquants"
Pipeline #2031 passed
$(document).ready(function() {
console.log('Custom JS loaded');
$(document).ready(function() {
console.log('Custom JS executed');
// Add specific classes to play buttons
$('button:contains("Play")').html('<i class="fa-solid fa-play"></i>');
});
/**
* 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!";
}
}
......@@ -79,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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment