use of uk.ac.ed.ph.jqtiplus.node.content.xhtml.text.P in project openolat by klemens.
the class AssessmentItemFactory method appendSimpleChoice.
public static SimpleChoice appendSimpleChoice(ChoiceInteraction choiceInteraction, String text, Identifier identifier) {
SimpleChoice newChoice = new SimpleChoice(choiceInteraction);
newChoice.setIdentifier(identifier);
P firstChoiceText = AssessmentItemFactory.getParagraph(newChoice, text);
newChoice.getFlowStatics().add(firstChoiceText);
choiceInteraction.getNodeGroups().getSimpleChoiceGroup().getSimpleChoices().add(newChoice);
return newChoice;
}
use of uk.ac.ed.ph.jqtiplus.node.content.xhtml.text.P in project openolat by klemens.
the class CSVToAssessmentItemConverter method processChoice_kprim.
private void processChoice_kprim(String[] parts, KPrimAssessmentItemBuilder kprimBuilder) {
String firstPart = parts[0].toLowerCase();
String answer = parts[1];
Identifier correctIncorrectIdentifier;
if ("+".equals(firstPart)) {
correctIncorrectIdentifier = QTI21Constants.CORRECT_IDENTIFIER;
} else {
correctIncorrectIdentifier = QTI21Constants.WRONG_IDENTIFIER;
}
List<SimpleAssociableChoice> choices = kprimBuilder.getKprimChoices();
SimpleAssociableChoice choice = choices.get(kprimPosition);
P choiceText = AssessmentItemFactory.getParagraph(choice, answer);
choice.getFlowStatics().clear();
choice.getFlowStatics().add(choiceText);
kprimBuilder.setAssociation(choice.getIdentifier(), correctIncorrectIdentifier);
kprimPosition++;
}
use of uk.ac.ed.ph.jqtiplus.node.content.xhtml.text.P in project openolat by klemens.
the class MultipleChoiceEditorController method doAddSimpleChoice.
private void doAddSimpleChoice(UserRequest ureq) {
ChoiceInteraction interaction = itemBuilder.getChoiceInteraction();
SimpleChoice newChoice = new SimpleChoice(interaction);
newChoice.setIdentifier(IdentifierGenerator.newAsIdentifier("mc"));
P firstChoiceText = AssessmentItemFactory.getParagraph(newChoice, translate("new.answer"));
newChoice.getFlowStatics().add(firstChoiceText);
wrapAnswer(ureq, newChoice);
flc.setDirty(true);
}
Aggregations