Skip to content
Snippets Groups Projects
Commit eec84560 authored by Eliott Sammier's avatar Eliott Sammier
Browse files

Allow raw HTML insertion to test Macao-legacy output

parent a20aa7f1
No related branches found
No related tags found
No related merge requests found
...@@ -5,11 +5,12 @@ function checkQuestion(question) { ...@@ -5,11 +5,12 @@ function checkQuestion(question) {
if (question.isAnswerCorrect()) { if (question.isAnswerCorrect()) {
correctIndic.node.className = "correct" correctIndic.node.className = "correct"
correctIndic.labelNode.innerText = "Correct"; correctIndic.labelNode.innerText = "Correct";
correctIndic.commentNode.innerText = question.getPropertyValue("correctComment", ""); // FIXME: this inserts raw HTML (see onTextMarkdown callback)
correctIndic.commentNode.innerHTML = question.getPropertyValue("correctComment", "");
} else { } else {
correctIndic.node.className = "incorrect"; correctIndic.node.className = "incorrect";
correctIndic.labelNode.innerText = "Incorrect"; correctIndic.labelNode.innerText = "Incorrect";
correctIndic.commentNode.innerText = question.getPropertyValue("incorrectComment", ""); correctIndic.commentNode.innerHTML = question.getPropertyValue("incorrectComment", "");
} }
console.log("question = ", question); console.log("question = ", question);
console.log(" correct = ", question.isAnswerCorrect()); console.log(" correct = ", question.isAnswerCorrect());
...@@ -66,6 +67,11 @@ $(function () { ...@@ -66,6 +67,11 @@ $(function () {
innerCss: "sd-btn nav-input" innerCss: "sd-btn nav-input"
}); });
survey.onTextMarkdown.add((survey, options) => {
// FIXME: this inserts raw HTML from the text, to remove as soon as Macao-Legacy converter
// can actually produce Markdown
options.html = options.text;
});
survey.onValueChanged.add((_, options) => { survey.onValueChanged.add((_, options) => {
console.log(options) console.log(options)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment