case QTIConstants.MESSAGE_SECTION_SUBMITTED :
// provide section feedback if enabled and existing
//SectionContext sc = act.getCurrentSectionContext();
if (info.isFeedback()) {
Output outp = info.getCurrentOutput();
GenericQTIElement el_feedback = outp.getEl_response();
if (el_feedback != null) displayFeedback(sb, el_feedback, ai, translator.getLocale());
}
if(!comp.getMenuDisplayConf().isEnabledMenu() && !comp.getMenuDisplayConf().isItemPageSequence()) {
SectionContext sc = ai.getAssessmentContext().getCurrentSectionContext();
displaySectionInfo(sb, sc, ai, comp, ubu, translator);
}
break;
case QTIConstants.MESSAGE_ASSESSMENT_SUBMITTED :
// provide assessment feedback if enabled and existing
if (info.isFeedback()) {
Output outp = info.getCurrentOutput();
GenericQTIElement el_feedback = outp.getEl_response();
if (el_feedback != null) displayFeedback(sb, el_feedback, ai, translator.getLocale());
}
break;
case QTIConstants.MESSAGE_SECTION_INFODEMANDED : // for menu item navigator
// provide some stats maybe
SectionContext sc = ai.getAssessmentContext().getCurrentSectionContext();
displaySectionInfo(sb, sc, ai, comp, ubu, translator);
break;
case QTIConstants.MESSAGE_ASSESSMENT_INFODEMANDED : // at the start of the test
displayAssessmentInfo(sb, act, ai, comp, ubu, translator);
break;
}
}
if (renderItems) {
boolean displayForm = true;
// First check wether we need to render a form.
// No form is needed if the current item has a matapplet object to be displayed.
// Matapplets will send their response back directly.
SectionContext sct = act.getCurrentSectionContext();
ItemContext itc = null;
if (sct != null && !ai.isSectionPage()) {
itc = sct.getCurrentItemContext();
if (itc != null) {
Item item = itc.getQtiItem();
if (item.getQTIIdent().startsWith("QTIEDIT:FLA:")) displayForm = false;
}
}
sb.append("<form action=\"");
ubu.buildURI(sb, new String[] { VelocityContainer.COMMAND_ID }, new String[] { "sitse" });
sb.append("\" id=\"ofo_iq_item\" method=\"post\">");
if (!ai.isSectionPage()) {
if (itc != null) displayItem(sb, renderer, ubu, itc, ai);
} else {
if (sct != null && sct.getItemContextCount() != 0)
displayItems(sb, renderer, ubu, sct, ai);
}
sb.append("<div class=\"b_button_group\"><input class=\"b_button\" type=\"submit\" name=\"olat_fosm\" value=\"");
if (ai.isSectionPage())
sb.append(StringEscapeUtils.escapeHtml(translator.translate("submitMultiAnswers")));
else
sb.append(StringEscapeUtils.escapeHtml(translator.translate("submitSingleAnswer")));
sb.append("\"");
if (!displayForm) sb.append(" style=\"display: none;\"");
sb.append(" /></div></form>");
}
if (status == QTIConstants.ASSESSMENT_FINISHED) {
if (info.isFeedback()) {
Output outp = info.getCurrentOutput();
GenericQTIElement el_feedback = outp.getEl_response();
if (el_feedback != null) displayFeedback(sb, el_feedback, ai, null);
}
}
return sb;
}