Search in sources :

Example 1 with BlockStatic

use of uk.ac.ed.ph.jqtiplus.node.content.basic.BlockStatic in project OpenOLAT by OpenOLAT.

the class HottextAssessmentItemBuilder method extractHottextInteraction.

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

Example 2 with BlockStatic

use of uk.ac.ed.ph.jqtiplus.node.content.basic.BlockStatic in project openolat by klemens.

the class HottextAssessmentItemBuilder method extractHottextInteraction.

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

Aggregations

IOException (java.io.IOException)2 StringOutput (org.olat.core.gui.render.StringOutput)2 AssessmentItemFactory.appendHottextInteraction (org.olat.ims.qti21.model.xml.AssessmentItemFactory.appendHottextInteraction)2 Block (uk.ac.ed.ph.jqtiplus.node.content.basic.Block)2 BlockStatic (uk.ac.ed.ph.jqtiplus.node.content.basic.BlockStatic)2 HottextInteraction (uk.ac.ed.ph.jqtiplus.node.item.interaction.HottextInteraction)2