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

Merge with 8ceef7d67239f202666d526b48600ecc841e58f3

parents a1f9c509 824ef76c
No related branches found
No related tags found
No related merge requests found
...@@ -187,3 +187,4 @@ ddfe863807617f21f6d75216bed144c791f5cab1 OpenOLAT 11.4.2 ...@@ -187,3 +187,4 @@ ddfe863807617f21f6d75216bed144c791f5cab1 OpenOLAT 11.4.2
25a2dc4dba8a7961ff4f19e33f709ddea5949141 OpenOLAT 11.4.3 25a2dc4dba8a7961ff4f19e33f709ddea5949141 OpenOLAT 11.4.3
f0de363ab794a6e0d6f4d6da57f460503d5dfa91 OpenOLAT 11.5.0 f0de363ab794a6e0d6f4d6da57f460503d5dfa91 OpenOLAT 11.5.0
dda2b6a8c3454872516fac37667698425802fc97 OpenOLAT 11.5.1 dda2b6a8c3454872516fac37667698425802fc97 OpenOLAT 11.5.1
355d21cc46068ffa18c18c479efa6d402cb484ec OpenOLAT 11.5.2
...@@ -24,6 +24,8 @@ import java.io.File; ...@@ -24,6 +24,8 @@ import java.io.File;
import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.lang.StringEscapeUtils;
import org.cyberneko.html.parsers.SAXParser; import org.cyberneko.html.parsers.SAXParser;
import org.json.JSONException;
import org.json.JSONObject;
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;
import org.olat.core.gui.components.form.flexible.FormItemContainer; import org.olat.core.gui.components.form.flexible.FormItemContainer;
...@@ -37,6 +39,7 @@ import org.olat.core.gui.control.Controller; ...@@ -37,6 +39,7 @@ import org.olat.core.gui.control.Controller;
import org.olat.core.gui.control.Event; import org.olat.core.gui.control.Event;
import org.olat.core.gui.control.WindowControl; import org.olat.core.gui.control.WindowControl;
import org.olat.core.gui.control.generic.closablewrapper.CloseableModalController; import org.olat.core.gui.control.generic.closablewrapper.CloseableModalController;
import org.olat.core.gui.control.winmgr.Command;
import org.olat.core.gui.control.winmgr.JSCommand; import org.olat.core.gui.control.winmgr.JSCommand;
import org.olat.core.util.StringHelper; import org.olat.core.util.StringHelper;
import org.olat.core.util.Util; import org.olat.core.util.Util;
...@@ -163,8 +166,15 @@ public class FIBEditorController extends FormBasicController { ...@@ -163,8 +166,15 @@ public class FIBEditorController extends FormBasicController {
} }
private void feedbackToTextElement(String responseIdentifier, String solution) { private void feedbackToTextElement(String responseIdentifier, String solution) {
JSCommand jsc = new JSCommand("try { tinymce.activeEditor.execCommand('qtiUpdateTextEntry', false, {\"responseIdentifier\":\"" + responseIdentifier + "\", \"data-qti-solution\": \"" + solution + "\"}); } catch(e){if(window.console) console.log(e) }"); try {
getWindowControl().getWindowBackOffice().sendCommandTo(jsc); JSONObject jo = new JSONObject();
jo.put("responseIdentifier", responseIdentifier);
jo.put("data-qti-solution", solution);
Command jsc = new JSCommand("try { tinymce.activeEditor.execCommand('qtiUpdateTextEntry', false, " + jo.toString() + "); } catch(e){if(window.console) console.log(e) }");
getWindowControl().getWindowBackOffice().sendCommandTo(jsc);
} catch (JSONException e) {
logError("", e);
}
} }
private void cleanUp() { private void cleanUp() {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
author : 'frentix GmbH', author : 'frentix GmbH',
authorurl : 'http://www.frentix.com', authorurl : 'http://www.frentix.com',
infourl : 'http://www.frentix.com', infourl : 'http://www.frentix.com',
version : '1.2.6' version : '1.2.7'
}; };
}, },
...@@ -407,9 +407,8 @@ ...@@ -407,9 +407,8 @@
} }
ed.addCommand('qtiUpdateTextEntry', function (ui, value) { ed.addCommand('qtiUpdateTextEntry', function (ui, value) {
var val = eval(value); var responseIdentifier = value['responseIdentifier'];
var responseIdentifier = val['responseIdentifier']; var solution = value['data-qti-solution'];
var solution = val['data-qti-solution'];
jQuery("span[data-qti-response-identifier='" + responseIdentifier+ "']>span", ed.getBody()).each(function(index, el) { jQuery("span[data-qti-response-identifier='" + responseIdentifier+ "']>span", ed.getBody()).each(function(index, el) {
jQuery(el).text(solution); jQuery(el).text(solution);
}); });
......
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