Search in sources :

Example 11 with UploadInteraction

use of uk.ac.ed.ph.jqtiplus.node.item.interaction.UploadInteraction in project openolat by klemens.

the class AssessmentTestHelper method needManualCorrection.

public static boolean needManualCorrection(AssessmentItemRef itemRef, ResolvedAssessmentTest resolvedAssessmentTest) {
    ResolvedAssessmentItem resolvedAssessmentItem = resolvedAssessmentTest.getResolvedAssessmentItem(itemRef);
    if (resolvedAssessmentItem != null && resolvedAssessmentItem.getItemLookup() != null && resolvedAssessmentItem.getItemLookup().getRootNodeHolder() != null) {
        AssessmentItem assessmentItem = resolvedAssessmentItem.getItemLookup().getRootNodeHolder().getRootNode();
        List<Interaction> interactions = assessmentItem.getItemBody().findInteractions();
        for (Interaction interaction : interactions) {
            if (interaction instanceof UploadInteraction || interaction instanceof DrawingInteraction || interaction instanceof ExtendedTextInteraction) {
                return true;
            }
        }
    }
    return false;
}
Also used : UploadInteraction(uk.ac.ed.ph.jqtiplus.node.item.interaction.UploadInteraction) ResolvedAssessmentItem(uk.ac.ed.ph.jqtiplus.resolution.ResolvedAssessmentItem) UploadInteraction(uk.ac.ed.ph.jqtiplus.node.item.interaction.UploadInteraction) Interaction(uk.ac.ed.ph.jqtiplus.node.item.interaction.Interaction) DrawingInteraction(uk.ac.ed.ph.jqtiplus.node.item.interaction.DrawingInteraction) ExtendedTextInteraction(uk.ac.ed.ph.jqtiplus.node.item.interaction.ExtendedTextInteraction) ResolvedAssessmentItem(uk.ac.ed.ph.jqtiplus.resolution.ResolvedAssessmentItem) AssessmentItem(uk.ac.ed.ph.jqtiplus.node.item.AssessmentItem) ExtendedTextInteraction(uk.ac.ed.ph.jqtiplus.node.item.interaction.ExtendedTextInteraction) DrawingInteraction(uk.ac.ed.ph.jqtiplus.node.item.interaction.DrawingInteraction)

Example 12 with UploadInteraction

use of uk.ac.ed.ph.jqtiplus.node.item.interaction.UploadInteraction in project openolat by klemens.

the class UploadAssessmentItemBuilder method getQuestionBlocks.

/**
 * @return A copy of the list of blocks which make the question.
 * 		The list is a copy and modification will not be persisted.
 */
public List<Block> getQuestionBlocks() {
    List<Block> blocks = assessmentItem.getItemBody().getBlocks();
    List<Block> questionBlocks = new ArrayList<>(blocks.size());
    for (Block block : blocks) {
        if (block instanceof UploadInteraction) {
            break;
        } else {
            questionBlocks.add(block);
        }
    }
    return questionBlocks;
}
Also used : AssessmentItemFactory.appendUploadInteraction(org.olat.ims.qti21.model.xml.AssessmentItemFactory.appendUploadInteraction) UploadInteraction(uk.ac.ed.ph.jqtiplus.node.item.interaction.UploadInteraction) ArrayList(java.util.ArrayList) Block(uk.ac.ed.ph.jqtiplus.node.content.basic.Block)

Aggregations

UploadInteraction (uk.ac.ed.ph.jqtiplus.node.item.interaction.UploadInteraction)12 DrawingInteraction (uk.ac.ed.ph.jqtiplus.node.item.interaction.DrawingInteraction)6 ExtendedTextInteraction (uk.ac.ed.ph.jqtiplus.node.item.interaction.ExtendedTextInteraction)6 Interaction (uk.ac.ed.ph.jqtiplus.node.item.interaction.Interaction)6 ArrayList (java.util.ArrayList)4 AssessmentItemFactory.appendUploadInteraction (org.olat.ims.qti21.model.xml.AssessmentItemFactory.appendUploadInteraction)4 Block (uk.ac.ed.ph.jqtiplus.node.content.basic.Block)4 AssessmentItem (uk.ac.ed.ph.jqtiplus.node.item.AssessmentItem)4 ResolvedAssessmentItem (uk.ac.ed.ph.jqtiplus.resolution.ResolvedAssessmentItem)4 File (java.io.File)2 IOException (java.io.IOException)2 BigDecimal (java.math.BigDecimal)2 FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)2 StringOutput (org.olat.core.gui.render.StringOutput)2 AssessmentItemSession (org.olat.ims.qti21.AssessmentItemSession)2 AssessmentTestSession (org.olat.ims.qti21.AssessmentTestSession)2 InteractionResultFormItem (org.olat.ims.qti21.ui.components.InteractionResultFormItem)2 TestPlanNode (uk.ac.ed.ph.jqtiplus.state.TestPlanNode)2 TestPlanNodeKey (uk.ac.ed.ph.jqtiplus.state.TestPlanNodeKey)2 TestSessionState (uk.ac.ed.ph.jqtiplus.state.TestSessionState)2