use of uk.ac.ed.ph.jqtiplus.group.item.interaction.choice.SimpleChoiceGroup in project openolat by klemens.
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;
}
Aggregations