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

Merge OpenOLAT 11.5 to OpenOLAT default branch with 8f2ecb2a529fd0313030e77218e68be89d89fa57

parents 695c622b 3bae01ad
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>
......
......@@ -412,6 +412,7 @@ public class CoursesWebService {
src = RepositoryManager.getInstance().lookupRepositoryEntry(copyFrom, false);
}
if(src == null) {
log.warn("Cannot find course to copy from: " + copyFrom);
return null;
}
OLATResource originalOres = OLATResourceManager.getInstance().findResourceable(src.getOlatResource());
......@@ -519,7 +520,6 @@ public class CoursesWebService {
String description, String softKey, int access, boolean membersOnly, String authors, String location,
String externalId, String externalRef, String managedFlags, CourseConfigVO courseConfigVO) {
String learningObjectives = shortTitle + " (Example of creating a new course)";
if(!StringHelper.containsNonWhitespace(reDisplayName)) {
reDisplayName = shortTitle;
}
......@@ -552,7 +552,7 @@ public class CoursesWebService {
addedEntry = repositoryService.update(addedEntry);
// create an empty course
CourseFactory.createCourse(addedEntry, shortTitle, longTitle, learningObjectives);
CourseFactory.createCourse(addedEntry, shortTitle, longTitle, "");
return prepareCourse(addedEntry, shortTitle, longTitle, courseConfigVO);
} catch (Exception e) {
......
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