Search in sources :

Example 1 with SimpleChoiceGroup

use of uk.ac.ed.ph.jqtiplus.group.item.interaction.choice.SimpleChoiceGroup in project OpenOLAT by OpenOLAT.

the class AssessmentItemFactory method createSingleChoiceInteraction.

public static ChoiceInteraction createSingleChoiceInteraction(AssessmentItem assessmentItem, Identifier responseDeclarationId, Orientation orientation, List<String> classAtrr) {
    ChoiceInteraction choiceInteraction = new ChoiceInteraction(assessmentItem.getItemBody());
    choiceInteraction.setMaxChoices(1);
    choiceInteraction.setShuffle(true);
    if (orientation != null) {
        choiceInteraction.setOrientation(orientation);
    }
    choiceInteraction.setResponseIdentifier(responseDeclarationId);
    if (classAtrr != null && classAtrr.size() > 0) {
        choiceInteraction.setClassAttr(classAtrr);
    }
    PromptGroup prompts = new PromptGroup(choiceInteraction);
    choiceInteraction.getNodeGroups().add(prompts);
    SimpleChoiceGroup singleChoices = new SimpleChoiceGroup(choiceInteraction);
    choiceInteraction.getNodeGroups().add(singleChoices);
    return choiceInteraction;
}
Also used : ChoiceInteraction(uk.ac.ed.ph.jqtiplus.node.item.interaction.ChoiceInteraction) PromptGroup(uk.ac.ed.ph.jqtiplus.group.item.interaction.PromptGroup) SimpleChoiceGroup(uk.ac.ed.ph.jqtiplus.group.item.interaction.choice.SimpleChoiceGroup)

Example 2 with SimpleChoiceGroup

use of uk.ac.ed.ph.jqtiplus.group.item.interaction.choice.SimpleChoiceGroup in project OpenOLAT by OpenOLAT.

the class AssessmentItemFactory method appendChoiceInteraction.

public static ChoiceInteraction appendChoiceInteraction(ItemBody itemBody, Identifier responseDeclarationId, int maxChoices, boolean shuffle) {
    ChoiceInteraction choiceInteraction = new ChoiceInteraction(itemBody);
    choiceInteraction.setMaxChoices(maxChoices);
    choiceInteraction.setShuffle(shuffle);
    choiceInteraction.setResponseIdentifier(responseDeclarationId);
    itemBody.getBlocks().add(choiceInteraction);
    PromptGroup prompts = new PromptGroup(choiceInteraction);
    choiceInteraction.getNodeGroups().add(prompts);
    SimpleChoiceGroup singleChoices = new SimpleChoiceGroup(choiceInteraction);
    choiceInteraction.getNodeGroups().add(singleChoices);
    return choiceInteraction;
}
Also used : ChoiceInteraction(uk.ac.ed.ph.jqtiplus.node.item.interaction.ChoiceInteraction) PromptGroup(uk.ac.ed.ph.jqtiplus.group.item.interaction.PromptGroup) SimpleChoiceGroup(uk.ac.ed.ph.jqtiplus.group.item.interaction.choice.SimpleChoiceGroup)

Example 3 with SimpleChoiceGroup

use of uk.ac.ed.ph.jqtiplus.group.item.interaction.choice.SimpleChoiceGroup in project openolat by klemens.

the class AssessmentItemFactory method createSingleChoiceInteraction.

public static ChoiceInteraction createSingleChoiceInteraction(AssessmentItem assessmentItem, Identifier responseDeclarationId, Orientation orientation, List<String> classAtrr) {
    ChoiceInteraction choiceInteraction = new ChoiceInteraction(assessmentItem.getItemBody());
    choiceInteraction.setMaxChoices(1);
    choiceInteraction.setShuffle(true);
    if (orientation != null) {
        choiceInteraction.setOrientation(orientation);
    }
    choiceInteraction.setResponseIdentifier(responseDeclarationId);
    if (classAtrr != null && classAtrr.size() > 0) {
        choiceInteraction.setClassAttr(classAtrr);
    }
    PromptGroup prompts = new PromptGroup(choiceInteraction);
    choiceInteraction.getNodeGroups().add(prompts);
    SimpleChoiceGroup singleChoices = new SimpleChoiceGroup(choiceInteraction);
    choiceInteraction.getNodeGroups().add(singleChoices);
    return choiceInteraction;
}
Also used : ChoiceInteraction(uk.ac.ed.ph.jqtiplus.node.item.interaction.ChoiceInteraction) PromptGroup(uk.ac.ed.ph.jqtiplus.group.item.interaction.PromptGroup) SimpleChoiceGroup(uk.ac.ed.ph.jqtiplus.group.item.interaction.choice.SimpleChoiceGroup)

Example 4 with SimpleChoiceGroup

use of uk.ac.ed.ph.jqtiplus.group.item.interaction.choice.SimpleChoiceGroup in project OpenOLAT by OpenOLAT.

the class AssessmentItemFactory method createMultipleChoiceInteraction.

public static ChoiceInteraction createMultipleChoiceInteraction(AssessmentItem assessmentItem, Identifier responseDeclarationId, Orientation orientation, List<String> classAtrr) {
    ChoiceInteraction choiceInteraction = new ChoiceInteraction(assessmentItem.getItemBody());
    choiceInteraction.setMaxChoices(0);
    choiceInteraction.setShuffle(true);
    if (orientation != null) {
        choiceInteraction.setOrientation(orientation);
    }
    if (classAtrr != null && classAtrr.size() > 0) {
        choiceInteraction.setClassAttr(classAtrr);
    }
    choiceInteraction.setResponseIdentifier(responseDeclarationId);
    PromptGroup prompts = new PromptGroup(choiceInteraction);
    choiceInteraction.getNodeGroups().add(prompts);
    SimpleChoiceGroup singleChoices = new SimpleChoiceGroup(choiceInteraction);
    choiceInteraction.getNodeGroups().add(singleChoices);
    return choiceInteraction;
}
Also used : ChoiceInteraction(uk.ac.ed.ph.jqtiplus.node.item.interaction.ChoiceInteraction) PromptGroup(uk.ac.ed.ph.jqtiplus.group.item.interaction.PromptGroup) SimpleChoiceGroup(uk.ac.ed.ph.jqtiplus.group.item.interaction.choice.SimpleChoiceGroup)

Example 5 with SimpleChoiceGroup

use of uk.ac.ed.ph.jqtiplus.group.item.interaction.choice.SimpleChoiceGroup in project openolat by klemens.

the class AssessmentItemFactory method createMultipleChoiceInteraction.

public static ChoiceInteraction createMultipleChoiceInteraction(AssessmentItem assessmentItem, Identifier responseDeclarationId, Orientation orientation, List<String> classAtrr) {
    ChoiceInteraction choiceInteraction = new ChoiceInteraction(assessmentItem.getItemBody());
    choiceInteraction.setMaxChoices(0);
    choiceInteraction.setShuffle(true);
    if (orientation != null) {
        choiceInteraction.setOrientation(orientation);
    }
    if (classAtrr != null && classAtrr.size() > 0) {
        choiceInteraction.setClassAttr(classAtrr);
    }
    choiceInteraction.setResponseIdentifier(responseDeclarationId);
    PromptGroup prompts = new PromptGroup(choiceInteraction);
    choiceInteraction.getNodeGroups().add(prompts);
    SimpleChoiceGroup singleChoices = new SimpleChoiceGroup(choiceInteraction);
    choiceInteraction.getNodeGroups().add(singleChoices);
    return choiceInteraction;
}
Also used : ChoiceInteraction(uk.ac.ed.ph.jqtiplus.node.item.interaction.ChoiceInteraction) PromptGroup(uk.ac.ed.ph.jqtiplus.group.item.interaction.PromptGroup) SimpleChoiceGroup(uk.ac.ed.ph.jqtiplus.group.item.interaction.choice.SimpleChoiceGroup)

Aggregations

PromptGroup (uk.ac.ed.ph.jqtiplus.group.item.interaction.PromptGroup)6 SimpleChoiceGroup (uk.ac.ed.ph.jqtiplus.group.item.interaction.choice.SimpleChoiceGroup)6 ChoiceInteraction (uk.ac.ed.ph.jqtiplus.node.item.interaction.ChoiceInteraction)6