Search in sources :

Example 1 with TextEntryInteractionsStatisticsController

use of org.olat.ims.qti21.ui.statistics.interactions.TextEntryInteractionsStatisticsController in project OpenOLAT by OpenOLAT.

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)

Example 2 with TextEntryInteractionsStatisticsController

use of org.olat.ims.qti21.ui.statistics.interactions.TextEntryInteractionsStatisticsController 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

ArrayList (java.util.ArrayList)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 HotspotInteractionStatisticsController (org.olat.ims.qti21.ui.statistics.interactions.HotspotInteractionStatisticsController)2 HottextInteractionStatisticsController (org.olat.ims.qti21.ui.statistics.interactions.HottextInteractionStatisticsController)2 KPrimStatisticsController (org.olat.ims.qti21.ui.statistics.interactions.KPrimStatisticsController)2 MatchStatisticsController (org.olat.ims.qti21.ui.statistics.interactions.MatchStatisticsController)2 SimpleChoiceInteractionStatisticsController (org.olat.ims.qti21.ui.statistics.interactions.SimpleChoiceInteractionStatisticsController)2 TextEntryInteractionsStatisticsController (org.olat.ims.qti21.ui.statistics.interactions.TextEntryInteractionsStatisticsController)2 UnsupportedInteractionController (org.olat.ims.qti21.ui.statistics.interactions.UnsupportedInteractionController)2 UserFilterController (org.olat.modules.assessment.ui.UserFilterController)2 ChoiceInteraction (uk.ac.ed.ph.jqtiplus.node.item.interaction.ChoiceInteraction)2 EndAttemptInteraction (uk.ac.ed.ph.jqtiplus.node.item.interaction.EndAttemptInteraction)2 HotspotInteraction (uk.ac.ed.ph.jqtiplus.node.item.interaction.HotspotInteraction)2 HottextInteraction (uk.ac.ed.ph.jqtiplus.node.item.interaction.HottextInteraction)2 Interaction (uk.ac.ed.ph.jqtiplus.node.item.interaction.Interaction)2 MatchInteraction (uk.ac.ed.ph.jqtiplus.node.item.interaction.MatchInteraction)2 TextEntryInteraction (uk.ac.ed.ph.jqtiplus.node.item.interaction.TextEntryInteraction)2