use of uk.ac.ed.ph.jqtiplus.node.content.xhtml.list.DlElement in project OpenOLAT by OpenOLAT.
the class AssessmentObjectComponentRenderer method renderBlock.
public void renderBlock(AssessmentRenderer renderer, StringOutput sb, AssessmentObjectComponent component, ResolvedAssessmentItem resolvedAssessmentItem, ItemSessionState itemSessionState, Block block, URLBuilder ubu, Translator translator) {
switch(block.getQtiClassName()) {
case AssociateInteraction.QTI_CLASS_NAME:
case ChoiceInteraction.QTI_CLASS_NAME:
case DrawingInteraction.QTI_CLASS_NAME:
case ExtendedTextInteraction.QTI_CLASS_NAME:
case GapMatchInteraction.QTI_CLASS_NAME:
case GraphicAssociateInteraction.QTI_CLASS_NAME:
case GraphicGapMatchInteraction.QTI_CLASS_NAME:
case GraphicOrderInteraction.QTI_CLASS_NAME:
case HotspotInteraction.QTI_CLASS_NAME:
case SelectPointInteraction.QTI_CLASS_NAME:
case HottextInteraction.QTI_CLASS_NAME:
case MatchInteraction.QTI_CLASS_NAME:
case MediaInteraction.QTI_CLASS_NAME:
case OrderInteraction.QTI_CLASS_NAME:
case PositionObjectInteraction.QTI_CLASS_NAME:
case SliderInteraction.QTI_CLASS_NAME:
case UploadInteraction.QTI_CLASS_NAME:
{
renderInteraction(renderer, sb, (FlowInteraction) block, resolvedAssessmentItem, itemSessionState, component, ubu, translator);
break;
}
case CustomInteraction.QTI_CLASS_NAME:
{
renderCustomInteraction(renderer, sb, (CustomInteraction<?>) block, resolvedAssessmentItem, itemSessionState, component, ubu, translator);
break;
}
case PositionObjectStage.QTI_CLASS_NAME:
{
renderPositionObjectStage(renderer, sb, (PositionObjectStage) block, resolvedAssessmentItem, itemSessionState, component, ubu, translator);
break;
}
// never rendered
case TemplateBlock.QTI_CLASS_NAME:
break;
case InfoControl.QTI_CLASS_NAME:
{
renderInfoControl(renderer, sb, component, resolvedAssessmentItem, itemSessionState, (InfoControl) block, ubu, translator);
break;
}
case FeedbackBlock.QTI_CLASS_NAME:
{
FeedbackBlock feedbackBlock = (FeedbackBlock) block;
if (component.isFeedback(feedbackBlock, itemSessionState)) {
sb.append("<div class='o_info feedbackBlock '").append(getAtClass(feedbackBlock)).append(">");
feedbackBlock.getBlocks().forEach((child) -> renderBlock(renderer, sb, component, resolvedAssessmentItem, itemSessionState, child, ubu, translator));
sb.append("</div>");
}
break;
}
// never rendered automatically
case RubricBlock.QTI_CLASS_NAME:
break;
case Math.QTI_CLASS_NAME:
{
renderMath(renderer, sb, component, resolvedAssessmentItem, itemSessionState, (Math) block);
break;
}
case Div.QTI_CLASS_NAME:
renderStartHtmlTag(sb, component, resolvedAssessmentItem, block, null);
((Div) block).getFlows().forEach((flow) -> renderFlow(renderer, sb, component, resolvedAssessmentItem, itemSessionState, flow, ubu, translator));
renderEndTag(sb, block);
break;
case Ul.QTI_CLASS_NAME:
renderStartHtmlTag(sb, component, resolvedAssessmentItem, block, null);
((Ul) block).getLis().forEach((li) -> renderLi(renderer, sb, component, resolvedAssessmentItem, itemSessionState, li, ubu, translator));
renderEndTag(sb, block);
break;
case Ol.QTI_CLASS_NAME:
renderStartHtmlTag(sb, component, resolvedAssessmentItem, block, null);
((Ol) block).getLis().forEach((li) -> renderLi(renderer, sb, component, resolvedAssessmentItem, itemSessionState, li, ubu, translator));
renderEndTag(sb, block);
break;
case Dl.QTI_CLASS_NAME:
renderStartHtmlTag(sb, component, resolvedAssessmentItem, block, null);
((Dl) block).getDlElements().forEach((dlElement) -> renderDlElement(renderer, sb, component, resolvedAssessmentItem, itemSessionState, dlElement, ubu, translator));
renderEndTag(sb, block);
break;
case Table.QTI_CLASS_NAME:
renderTable(renderer, sb, component, resolvedAssessmentItem, itemSessionState, (Table) block, ubu, translator);
break;
case Object.QTI_CLASS_NAME:
System.out.println("1");
break;
default:
{
renderStartHtmlTag(sb, component, resolvedAssessmentItem, block, null);
if (block instanceof AtomicBlock) {
AtomicBlock atomicBlock = (AtomicBlock) block;
atomicBlock.getInlines().forEach((child) -> renderInline(renderer, sb, component, resolvedAssessmentItem, itemSessionState, child, ubu, translator));
} else if (block instanceof SimpleBlock) {
SimpleBlock simpleBlock = (SimpleBlock) block;
simpleBlock.getBlocks().forEach((child) -> renderBlock(renderer, sb, component, resolvedAssessmentItem, itemSessionState, child, ubu, translator));
}
renderEndTag(sb, block);
}
}
}
use of uk.ac.ed.ph.jqtiplus.node.content.xhtml.list.DlElement in project openolat by klemens.
the class AssessmentObjectComponentRenderer method renderBlock.
public void renderBlock(AssessmentRenderer renderer, StringOutput sb, AssessmentObjectComponent component, ResolvedAssessmentItem resolvedAssessmentItem, ItemSessionState itemSessionState, Block block, URLBuilder ubu, Translator translator) {
switch(block.getQtiClassName()) {
case AssociateInteraction.QTI_CLASS_NAME:
case ChoiceInteraction.QTI_CLASS_NAME:
case DrawingInteraction.QTI_CLASS_NAME:
case ExtendedTextInteraction.QTI_CLASS_NAME:
case GapMatchInteraction.QTI_CLASS_NAME:
case GraphicAssociateInteraction.QTI_CLASS_NAME:
case GraphicGapMatchInteraction.QTI_CLASS_NAME:
case GraphicOrderInteraction.QTI_CLASS_NAME:
case HotspotInteraction.QTI_CLASS_NAME:
case SelectPointInteraction.QTI_CLASS_NAME:
case HottextInteraction.QTI_CLASS_NAME:
case MatchInteraction.QTI_CLASS_NAME:
case MediaInteraction.QTI_CLASS_NAME:
case OrderInteraction.QTI_CLASS_NAME:
case PositionObjectInteraction.QTI_CLASS_NAME:
case SliderInteraction.QTI_CLASS_NAME:
case UploadInteraction.QTI_CLASS_NAME:
{
renderInteraction(renderer, sb, (FlowInteraction) block, resolvedAssessmentItem, itemSessionState, component, ubu, translator);
break;
}
case CustomInteraction.QTI_CLASS_NAME:
{
renderCustomInteraction(renderer, sb, (CustomInteraction<?>) block, resolvedAssessmentItem, itemSessionState, component, ubu, translator);
break;
}
case PositionObjectStage.QTI_CLASS_NAME:
{
renderPositionObjectStage(renderer, sb, (PositionObjectStage) block, resolvedAssessmentItem, itemSessionState, component, ubu, translator);
break;
}
// never rendered
case TemplateBlock.QTI_CLASS_NAME:
break;
case InfoControl.QTI_CLASS_NAME:
{
renderInfoControl(renderer, sb, component, resolvedAssessmentItem, itemSessionState, (InfoControl) block, ubu, translator);
break;
}
case FeedbackBlock.QTI_CLASS_NAME:
{
FeedbackBlock feedbackBlock = (FeedbackBlock) block;
if (component.isFeedback(feedbackBlock, itemSessionState)) {
sb.append("<div class='o_info feedbackBlock '").append(getAtClass(feedbackBlock)).append(">");
feedbackBlock.getBlocks().forEach((child) -> renderBlock(renderer, sb, component, resolvedAssessmentItem, itemSessionState, child, ubu, translator));
sb.append("</div>");
}
break;
}
// never rendered automatically
case RubricBlock.QTI_CLASS_NAME:
break;
case Math.QTI_CLASS_NAME:
{
renderMath(renderer, sb, component, resolvedAssessmentItem, itemSessionState, (Math) block);
break;
}
case Div.QTI_CLASS_NAME:
renderStartHtmlTag(sb, component, resolvedAssessmentItem, block, null);
((Div) block).getFlows().forEach((flow) -> renderFlow(renderer, sb, component, resolvedAssessmentItem, itemSessionState, flow, ubu, translator));
renderEndTag(sb, block);
break;
case Ul.QTI_CLASS_NAME:
renderStartHtmlTag(sb, component, resolvedAssessmentItem, block, null);
((Ul) block).getLis().forEach((li) -> renderLi(renderer, sb, component, resolvedAssessmentItem, itemSessionState, li, ubu, translator));
renderEndTag(sb, block);
break;
case Ol.QTI_CLASS_NAME:
renderStartHtmlTag(sb, component, resolvedAssessmentItem, block, null);
((Ol) block).getLis().forEach((li) -> renderLi(renderer, sb, component, resolvedAssessmentItem, itemSessionState, li, ubu, translator));
renderEndTag(sb, block);
break;
case Dl.QTI_CLASS_NAME:
renderStartHtmlTag(sb, component, resolvedAssessmentItem, block, null);
((Dl) block).getDlElements().forEach((dlElement) -> renderDlElement(renderer, sb, component, resolvedAssessmentItem, itemSessionState, dlElement, ubu, translator));
renderEndTag(sb, block);
break;
case Table.QTI_CLASS_NAME:
renderTable(renderer, sb, component, resolvedAssessmentItem, itemSessionState, (Table) block, ubu, translator);
break;
case Object.QTI_CLASS_NAME:
System.out.println("1");
break;
default:
{
renderStartHtmlTag(sb, component, resolvedAssessmentItem, block, null);
if (block instanceof AtomicBlock) {
AtomicBlock atomicBlock = (AtomicBlock) block;
atomicBlock.getInlines().forEach((child) -> renderInline(renderer, sb, component, resolvedAssessmentItem, itemSessionState, child, ubu, translator));
} else if (block instanceof SimpleBlock) {
SimpleBlock simpleBlock = (SimpleBlock) block;
simpleBlock.getBlocks().forEach((child) -> renderBlock(renderer, sb, component, resolvedAssessmentItem, itemSessionState, child, ubu, translator));
}
renderEndTag(sb, block);
}
}
}
Aggregations