use of org.olat.ims.qti.process.Resolver in project OpenOLAT by OpenOLAT.
the class ResultsBuilder method addStaticsPath.
private static void addStaticsPath(Element el_in, AssessmentInstance ai) {
Element el_staticspath = (Element) el_in.selectSingleNode(STATICS_PATH);
if (el_staticspath == null) {
DocumentFactory df = DocumentFactory.getInstance();
el_staticspath = df.createElement(STATICS_PATH);
Resolver resolver = ai.getResolver();
el_staticspath.addAttribute("ident", resolver.getStaticsBaseURI());
el_in.add(el_staticspath);
}
}
use of org.olat.ims.qti.process.Resolver in project OpenOLAT by OpenOLAT.
the class IQComponentRenderer method displayItem.
private void displayItem(StringOutput sb, Renderer renderer, URLBuilder ubu, ItemContext itc, AssessmentInstance ai) {
StringBuilder buffer = new StringBuilder(1000);
Resolver resolver = ai.getResolver();
RenderInstructions ri = new RenderInstructions();
ri.put(RenderInstructions.KEY_STATICS_PATH, resolver.getStaticsBaseURI() + "/");
ri.put(RenderInstructions.KEY_LOCALE, renderer.getTranslator().getLocale());
StringOutput soCommandURI = new StringOutput(50);
ubu.buildURI(soCommandURI, new String[] { VelocityContainer.COMMAND_ID }, new String[] { "sflash" });
ri.put(RenderInstructions.KEY_APPLET_SUBMIT_URI, soCommandURI.toString());
if (itc.getItemInput() != null)
ri.put(RenderInstructions.KEY_ITEM_INPUT, itc.getItemInput());
ri.put(RenderInstructions.KEY_RENDER_TITLE, Boolean.valueOf(ai.isDisplayTitles()));
if (ai.isAutoEnum()) {
String k = renderer.getTranslator().translate("choices.autoenum.keys");
if (k != null) {
ri.put(RenderInstructions.KEY_RENDER_AUTOENUM_LIST, k);
}
}
itc.getQtiItem().render(buffer, ri);
sb.append(buffer);
}
use of org.olat.ims.qti.process.Resolver in project openolat by klemens.
the class IQComponentRenderer method displayFeedback.
private void displayFeedback(StringOutput sb, GenericQTIElement feedback, AssessmentInstance ai, Locale locale) {
StringBuilder sbTmp = new StringBuilder();
Resolver resolver = ai.getResolver();
RenderInstructions ri = new RenderInstructions();
ri.put(RenderInstructions.KEY_STATICS_PATH, resolver.getStaticsBaseURI() + "/");
ri.put(RenderInstructions.KEY_LOCALE, locale);
feedback.render(sbTmp, ri);
sb.append(sbTmp);
}
use of org.olat.ims.qti.process.Resolver in project openolat by klemens.
the class IQComponentRenderer method displayItem.
private void displayItem(StringOutput sb, Renderer renderer, URLBuilder ubu, ItemContext itc, AssessmentInstance ai) {
StringBuilder buffer = new StringBuilder(1000);
Resolver resolver = ai.getResolver();
RenderInstructions ri = new RenderInstructions();
ri.put(RenderInstructions.KEY_STATICS_PATH, resolver.getStaticsBaseURI() + "/");
ri.put(RenderInstructions.KEY_LOCALE, renderer.getTranslator().getLocale());
StringOutput soCommandURI = new StringOutput(50);
ubu.buildURI(soCommandURI, new String[] { VelocityContainer.COMMAND_ID }, new String[] { "sflash" });
ri.put(RenderInstructions.KEY_APPLET_SUBMIT_URI, soCommandURI.toString());
if (itc.getItemInput() != null)
ri.put(RenderInstructions.KEY_ITEM_INPUT, itc.getItemInput());
ri.put(RenderInstructions.KEY_RENDER_TITLE, Boolean.valueOf(ai.isDisplayTitles()));
if (ai.isAutoEnum()) {
String k = renderer.getTranslator().translate("choices.autoenum.keys");
if (k != null) {
ri.put(RenderInstructions.KEY_RENDER_AUTOENUM_LIST, k);
}
}
itc.getQtiItem().render(buffer, ri);
sb.append(buffer);
}
use of org.olat.ims.qti.process.Resolver in project OpenOLAT by OpenOLAT.
the class OnyxModule method isOnyxTest.
public static boolean isOnyxTest(final OLATResourceable res) {
if (res.getResourceableTypeName().equals(TestFileResource.TYPE_NAME) || res.getResourceableTypeName().equals(SurveyFileResource.TYPE_NAME)) {
Long resourceId = res.getResourceableId();
Boolean onyx = onyxMap.get(resourceId);
if (onyx == null) {
onyx = Boolean.FALSE;
try {
final Resolver resolver = new ImsRepositoryResolver(res);
// search for qti.xml, it not exists for qti2
if (resolver.getQTIDocument() == null) {
onyx = Boolean.TRUE;
} else {
onyx = Boolean.FALSE;
}
} catch (OLATRuntimeException e) {
log.error("", e);
}
onyxMap.put(resourceId, onyx);
}
return onyx.booleanValue();
} else {
return false;
}
}
Aggregations