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

Merge OpenOLAT 11.4 to OpenOLAT 11.5 with d35edbaf348147004e8ccdaedd886b43519cbffd

parents 9b1393a2 49be9303
No related branches found
No related tags found
No related merge requests found
......@@ -343,6 +343,16 @@ public class VelocityRenderDecorator implements Closeable {
return sb;
}
public StringOutput mathJaxCdnFullUrl() {
StringOutput sb = new StringOutput(100);
if(WebappHelper.getMathJaxCdn().startsWith("http")) {
sb.append(WebappHelper.getMathJaxCdn());
} else {
sb.append("https:").append(WebappHelper.getMathJaxCdn());
}
return sb;
}
public StringOutput contextPath() {
StringOutput sb = new StringOutput(100);
sb.append(Settings.getServerContextPath());
......
<!DOCTYPE HTML>
<html>
<head>
<title>$rootTitle</title>
<link rel='stylesheet' href='../../../css/offline/qti/theme.css' />
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
</head>
<body class="o_page_margins">
<div id="o_main">$r.render("results")</div>
</body>
</html>
\ No newline at end of file
......@@ -53,6 +53,7 @@ import org.olat.core.gui.render.Renderer;
import org.olat.core.gui.render.StringOutput;
import org.olat.core.gui.render.URLBuilder;
import org.olat.core.gui.render.velocity.VelocityHelper;
import org.olat.core.gui.render.velocity.VelocityRenderDecorator;
import org.olat.core.gui.translator.Translator;
import org.olat.core.gui.util.WindowControlMocker;
import org.olat.core.id.Identity;
......@@ -328,9 +329,10 @@ public class QTI21ResultsExportMediaResource implements MediaResource {
mainVC.contextPut("rootTitle", translator.translate("table.grading"));
mainVC.put("results", results);
//render VelocityContainer to StringOutPut
Renderer renderer = Renderer.getInstance(mainVC, translator, ubu, new RenderResult(), new EmptyGlobalSettings());
Renderer renderer = Renderer.getInstance(mainVC, translator, ubu, new RenderResult(), new EmptyGlobalSettings());
VelocityRenderDecorator vrdec = new VelocityRenderDecorator(renderer, mainVC, sb);
mainVC.contextPut("r", vrdec);
renderer.render(sb, mainVC, null);
return sb.toString();
}
......
<!DOCTYPE HTML>
<html>
<head>
......@@ -24,6 +25,45 @@
function setFlexiFormDirtyByListener(e){
//
}
function o_mathjax() {
jQuery.ajax("${r.mathJaxCdnFullUrl()}MathJax.js?config=TeX-AMS-MML_HTMLorMML", {
cache: true,
dataType: "script",
success: function() {
MathJax.Hub.Config({
extensions: ["jsMath2jax.js"],
messageStyle: 'none',
showProcessingMessages: false,
showMathMenu: false,
menuSettings: { },
jsMath2jax: {
preview: "none"
},
tex2jax: {
ignoreClass: "math"
},
"HTML-CSS": {
EqnChunk: 5, EqnChunkFactor: 1, EqnChunkDelay: 100
},
"fast-preview": {
disabled: true
}
});
}
});
}
var BFormatter = {
// format on load
formatLatexFormulas : function(domId) {}
};
jQuery(function() {
if ((window.unsafeWindow == null ? window : unsafeWindow).MathJax == null) {
var count = jQuery('div.math,span.math,math,div.mathEntryInteraction').length;
if (count > 0) {
o_mathjax();
}
}
});
/* ]]> */
</script>
</head>
......
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