Search in sources :

Example 26 with P

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;
}
Also used : P(uk.ac.ed.ph.jqtiplus.node.content.xhtml.text.P) SimpleChoice(uk.ac.ed.ph.jqtiplus.node.item.interaction.choice.SimpleChoice)

Example 27 with P

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++;
}
Also used : P(uk.ac.ed.ph.jqtiplus.node.content.xhtml.text.P) SimpleAssociableChoice(uk.ac.ed.ph.jqtiplus.node.item.interaction.choice.SimpleAssociableChoice) Identifier(uk.ac.ed.ph.jqtiplus.types.Identifier)

Example 28 with P

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);
}
Also used : P(uk.ac.ed.ph.jqtiplus.node.content.xhtml.text.P) SimpleChoice(uk.ac.ed.ph.jqtiplus.node.item.interaction.choice.SimpleChoice) ChoiceInteraction(uk.ac.ed.ph.jqtiplus.node.item.interaction.ChoiceInteraction)

Aggregations

P (uk.ac.ed.ph.jqtiplus.node.content.xhtml.text.P)28 SimpleAssociableChoice (uk.ac.ed.ph.jqtiplus.node.item.interaction.choice.SimpleAssociableChoice)12 TextRun (uk.ac.ed.ph.jqtiplus.node.content.basic.TextRun)10 SimpleChoice (uk.ac.ed.ph.jqtiplus.node.item.interaction.choice.SimpleChoice)8 PromptGroup (uk.ac.ed.ph.jqtiplus.group.item.interaction.PromptGroup)4 AssessmentItem (uk.ac.ed.ph.jqtiplus.node.item.AssessmentItem)4 MatchInteraction (uk.ac.ed.ph.jqtiplus.node.item.interaction.MatchInteraction)4 SimpleMatchSet (uk.ac.ed.ph.jqtiplus.node.item.interaction.choice.SimpleMatchSet)4 ResponseDeclaration (uk.ac.ed.ph.jqtiplus.node.item.response.declaration.ResponseDeclaration)4 Identifier (uk.ac.ed.ph.jqtiplus.types.Identifier)4 ArrayList (java.util.ArrayList)2 Test (org.junit.Test)2 ChoiceQuestion (org.olat.ims.qti.editor.beecom.objects.ChoiceQuestion)2 ChoiceResponse (org.olat.ims.qti.editor.beecom.objects.ChoiceResponse)2 EssayQuestion (org.olat.ims.qti.editor.beecom.objects.EssayQuestion)2 EssayResponse (org.olat.ims.qti.editor.beecom.objects.EssayResponse)2 FIBResponse (org.olat.ims.qti.editor.beecom.objects.FIBResponse)2 Question (org.olat.ims.qti.editor.beecom.objects.Question)2 Response (org.olat.ims.qti.editor.beecom.objects.Response)2 AssessmentItemFactory.appendDefaultItemBody (org.olat.ims.qti21.model.xml.AssessmentItemFactory.appendDefaultItemBody)2