Search in sources :

Example 16 with TextEntryInteraction

use of uk.ac.ed.ph.jqtiplus.node.item.interaction.TextEntryInteraction 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;
}
Also used : TextEntryInteraction(uk.ac.ed.ph.jqtiplus.node.item.interaction.TextEntryInteraction) EndAttemptInteraction(uk.ac.ed.ph.jqtiplus.node.item.interaction.EndAttemptInteraction) TextEntryInteractionsStatisticsController(org.olat.ims.qti21.ui.statistics.interactions.TextEntryInteractionsStatisticsController) HottextInteraction(uk.ac.ed.ph.jqtiplus.node.item.interaction.HottextInteraction) TextEntryInteraction(uk.ac.ed.ph.jqtiplus.node.item.interaction.TextEntryInteraction) HotspotInteraction(uk.ac.ed.ph.jqtiplus.node.item.interaction.HotspotInteraction) Interaction(uk.ac.ed.ph.jqtiplus.node.item.interaction.Interaction) ChoiceInteraction(uk.ac.ed.ph.jqtiplus.node.item.interaction.ChoiceInteraction) EndAttemptInteraction(uk.ac.ed.ph.jqtiplus.node.item.interaction.EndAttemptInteraction) MatchInteraction(uk.ac.ed.ph.jqtiplus.node.item.interaction.MatchInteraction) ArrayList(java.util.ArrayList) StatisticsComponent(org.olat.core.gui.components.chart.StatisticsComponent) Component(org.olat.core.gui.components.Component) TextEntryInteractionsStatisticsController(org.olat.ims.qti21.ui.statistics.interactions.TextEntryInteractionsStatisticsController) HotspotInteractionStatisticsController(org.olat.ims.qti21.ui.statistics.interactions.HotspotInteractionStatisticsController) MatchStatisticsController(org.olat.ims.qti21.ui.statistics.interactions.MatchStatisticsController) UserFilterController(org.olat.modules.assessment.ui.UserFilterController) SimpleChoiceInteractionStatisticsController(org.olat.ims.qti21.ui.statistics.interactions.SimpleChoiceInteractionStatisticsController) KPrimStatisticsController(org.olat.ims.qti21.ui.statistics.interactions.KPrimStatisticsController) HottextInteractionStatisticsController(org.olat.ims.qti21.ui.statistics.interactions.HottextInteractionStatisticsController) Controller(org.olat.core.gui.control.Controller) BasicController(org.olat.core.gui.control.controller.BasicController) UnsupportedInteractionController(org.olat.ims.qti21.ui.statistics.interactions.UnsupportedInteractionController)

Aggregations

TextEntryInteraction (uk.ac.ed.ph.jqtiplus.node.item.interaction.TextEntryInteraction)16 Interaction (uk.ac.ed.ph.jqtiplus.node.item.interaction.Interaction)10 ArrayList (java.util.ArrayList)6 ResponseDeclaration (uk.ac.ed.ph.jqtiplus.node.item.response.declaration.ResponseDeclaration)6 Test (org.junit.Test)4 AssessmentItemFactory.appendTextEntryInteraction (org.olat.ims.qti21.model.xml.AssessmentItemFactory.appendTextEntryInteraction)4 AssessmentItem (uk.ac.ed.ph.jqtiplus.node.item.AssessmentItem)4 ChoiceInteraction (uk.ac.ed.ph.jqtiplus.node.item.interaction.ChoiceInteraction)4 HotspotInteraction (uk.ac.ed.ph.jqtiplus.node.item.interaction.HotspotInteraction)4 MatchInteraction (uk.ac.ed.ph.jqtiplus.node.item.interaction.MatchInteraction)4 HashMap (java.util.HashMap)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 DoubleAdder (java.util.concurrent.atomic.DoubleAdder)2 Component (org.olat.core.gui.components.Component)2 StatisticsComponent (org.olat.core.gui.components.chart.StatisticsComponent)2 Controller (org.olat.core.gui.control.Controller)2 BasicController (org.olat.core.gui.control.controller.BasicController)2 AbstractTextEntryInteractionStatistics (org.olat.ims.qti21.model.statistics.AbstractTextEntryInteractionStatistics)2 NumericalInputInteractionStatistics (org.olat.ims.qti21.model.statistics.NumericalInputInteractionStatistics)2 TextEntryInteractionStatistics (org.olat.ims.qti21.model.statistics.TextEntryInteractionStatistics)2