use of uk.ac.ed.ph.jqtiplus.node.item.interaction.Interaction in project openolat by klemens.
the class InteractionResultComponentRenderer method render.
@Override
public void render(Renderer renderer, StringOutput sb, Component source, URLBuilder ubu, Translator translator, RenderResult renderResult, String[] args) {
InteractionResultComponent cmp = (InteractionResultComponent) source;
Interaction interaction = cmp.getInteraction();
ResolvedAssessmentItem resolvedAssessmentItem = cmp.getResolvedAssessmentItem();
ItemSessionState itemSessionState = cmp.getItemSessionState();
AssessmentRenderer assessmentRenderer = new AssessmentRenderer(renderer);
if (cmp.isShowSolution()) {
assessmentRenderer.setSolutionAllowed(true);
assessmentRenderer.setSolutionMode(true);
} else {
assessmentRenderer.setReviewMode(true);
}
if (interaction instanceof Block) {
renderBlock(assessmentRenderer, sb, cmp, resolvedAssessmentItem, itemSessionState, (Block) interaction, ubu, translator);
} else if (interaction instanceof Flow) {
renderFlow(assessmentRenderer, sb, cmp, resolvedAssessmentItem, itemSessionState, (Flow) interaction, ubu, translator);
}
}
use of uk.ac.ed.ph.jqtiplus.node.item.interaction.Interaction in project openolat by klemens.
the class QTI21AssessmentItemStatisticsController method initInteractionControllers.
private List<String> initInteractionControllers(UserRequest ureq, StatisticsItem itemStats) {
List<Interaction> interactions = item.getItemBody().findInteractions();
List<String> interactionIds = new ArrayList<>(interactions.size());
int counter = 0;
List<TextEntryInteraction> textEntryInteractions = new ArrayList<>();
for (Interaction interaction : interactions) {
if (interaction instanceof TextEntryInteraction) {
textEntryInteractions.add((TextEntryInteraction) interaction);
} else if (interaction instanceof EndAttemptInteraction) {
continue;
} else {
Component cmp = interactionControllerFactory(ureq, interaction, itemStats);
String componentId = "interaction" + counter++;
mainVC.put(componentId, cmp);
interactionIds.add(componentId);
}
}
if (textEntryInteractions.size() > 0) {
Controller interactionCtrl = new TextEntryInteractionsStatisticsController(ureq, getWindowControl(), itemRef, item, textEntryInteractions, resourceResult);
listenTo(interactionCtrl);
String componentId = "interaction" + counter++;
mainVC.put(componentId, interactionCtrl.getInitialComponent());
interactionIds.add(componentId);
}
return interactionIds;
}
Aggregations