Skip to content
Snippets Groups Projects
Commit 500464cf authored by srosse's avatar srosse
Browse files

OO-2858: unescape solution of gap text from the tinymce mce plugin because...

OO-2858: unescape solution of gap text from the tinymce mce plugin because they are send to it escaped
parent 4a6bde49
No related branches found
No related tags found
No related merge requests found
...@@ -22,6 +22,7 @@ package org.olat.ims.qti21.ui.editor.interactions; ...@@ -22,6 +22,7 @@ package org.olat.ims.qti21.ui.editor.interactions;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.File; import java.io.File;
import org.apache.commons.lang.StringEscapeUtils;
import org.cyberneko.html.parsers.SAXParser; import org.cyberneko.html.parsers.SAXParser;
import org.olat.core.gui.UserRequest; import org.olat.core.gui.UserRequest;
import org.olat.core.gui.components.form.flexible.FormItem; import org.olat.core.gui.components.form.flexible.FormItem;
...@@ -330,6 +331,7 @@ public class FIBEditorController extends FormBasicController { ...@@ -330,6 +331,7 @@ public class FIBEditorController extends FormBasicController {
if("true".equals(solutionEmpty)) { if("true".equals(solutionEmpty)) {
((TextEntry)entry).setSolution(""); ((TextEntry)entry).setSolution("");
} else { } else {
solution = StringEscapeUtils.unescapeHtml(solution);
((TextEntry)entry).setSolution(solution); ((TextEntry)entry).setSolution(solution);
} }
} else if(entry instanceof NumericalEntry) { } else if(entry instanceof NumericalEntry) {
...@@ -356,6 +358,9 @@ public class FIBEditorController extends FormBasicController { ...@@ -356,6 +358,9 @@ public class FIBEditorController extends FormBasicController {
String name = attributes.getLocalName(i); String name = attributes.getLocalName(i);
if("data-qti-solution".equals(name)) { if("data-qti-solution".equals(name)) {
solution = attributes.getValue(i); solution = attributes.getValue(i);
if(solution != null) {
solution = StringEscapeUtils.unescapeHtml(solution);
}
} else if("data-qti-solution-empty".equals(name)) { } else if("data-qti-solution-empty".equals(name)) {
solutionEmpty = attributes.getValue(i); solutionEmpty = attributes.getValue(i);
} else if("responseIdentifier".equalsIgnoreCase(name)) { } else if("responseIdentifier".equalsIgnoreCase(name)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment