Search in sources :

Example 11 with DrawingInteraction

use of uk.ac.ed.ph.jqtiplus.node.item.interaction.DrawingInteraction 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 DrawingInteraction

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

the class DrawingAssessmentItemBuilder method extractExtendedTextInteraction.

private void extractExtendedTextInteraction() {
    try (StringOutput sb = new StringOutput()) {
        List<Block> blocks = assessmentItem.getItemBody().getBlocks();
        for (Block block : blocks) {
            if (block instanceof DrawingInteraction) {
                drawingInteraction = (DrawingInteraction) block;
                responseIdentifier = drawingInteraction.getResponseIdentifier();
                break;
            } else {
                serializeJqtiObject(block, sb);
            }
        }
        question = sb.toString();
    } catch (IOException e) {
        log.error("", e);
    }
}
Also used : Block(uk.ac.ed.ph.jqtiplus.node.content.basic.Block) StringOutput(org.olat.core.gui.render.StringOutput) IOException(java.io.IOException) AssessmentItemFactory.appendDrawingInteraction(org.olat.ims.qti21.model.xml.AssessmentItemFactory.appendDrawingInteraction) DrawingInteraction(uk.ac.ed.ph.jqtiplus.node.item.interaction.DrawingInteraction)

Aggregations

DrawingInteraction (uk.ac.ed.ph.jqtiplus.node.item.interaction.DrawingInteraction)12 ExtendedTextInteraction (uk.ac.ed.ph.jqtiplus.node.item.interaction.ExtendedTextInteraction)6 Interaction (uk.ac.ed.ph.jqtiplus.node.item.interaction.Interaction)6 UploadInteraction (uk.ac.ed.ph.jqtiplus.node.item.interaction.UploadInteraction)6 ArrayList (java.util.ArrayList)4 AssessmentItemFactory.appendDrawingInteraction (org.olat.ims.qti21.model.xml.AssessmentItemFactory.appendDrawingInteraction)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