Search in sources :

Example 11 with SectionPart

use of uk.ac.ed.ph.jqtiplus.node.test.SectionPart in project openolat by klemens.

the class AssessmentTestEditorAndComposerTreeModel method buildRecursively.

private void buildRecursively(AssessmentSection section, TreeNode parentNode) {
    GenericTreeNode sectionNode = new GenericTreeNode(section.getIdentifier().toString());
    sectionNode.setTitle(section.getTitle());
    sectionNode.setIconCssClass("o_icon o_mi_qtisection");
    sectionNode.setUserObject(section);
    parentNode.addChild(sectionNode);
    for (SectionPart part : section.getSectionParts()) {
        if (part instanceof AssessmentItemRef) {
            buildRecursively((AssessmentItemRef) part, sectionNode);
        } else if (part instanceof AssessmentSection) {
            buildRecursively((AssessmentSection) part, sectionNode);
        }
    }
}
Also used : SectionPart(uk.ac.ed.ph.jqtiplus.node.test.SectionPart) GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) AssessmentSection(uk.ac.ed.ph.jqtiplus.node.test.AssessmentSection) AssessmentItemRef(uk.ac.ed.ph.jqtiplus.node.test.AssessmentItemRef)

Example 12 with SectionPart

use of uk.ac.ed.ph.jqtiplus.node.test.SectionPart in project openolat by klemens.

the class QTI21StatisticResourceResult method buildRecursively.

private TreeNode buildRecursively(AssessmentSection section, TreeNode parentNode) {
    GenericTreeNode sectionNode = new GenericTreeNode();
    sectionNode.setTitle(section.getTitle());
    sectionNode.setIconCssClass("o_icon o_mi_qtisection");
    sectionNode.setUserObject(section);
    parentNode.addChild(sectionNode);
    TreeNode firstItem = null;
    for (SectionPart part : section.getSectionParts()) {
        TreeNode itemNode = null;
        if (part instanceof AssessmentItemRef) {
            itemNode = buildRecursively((AssessmentItemRef) part, sectionNode);
        } else if (part instanceof AssessmentSection) {
            itemNode = buildRecursively((AssessmentSection) part, sectionNode);
        }
        if (firstItem == null) {
            firstItem = itemNode;
        }
    }
    sectionNode.setDelegate(firstItem);
    return firstItem;
}
Also used : SectionPart(uk.ac.ed.ph.jqtiplus.node.test.SectionPart) GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) TreeNode(org.olat.core.gui.components.tree.TreeNode) AssessmentSection(uk.ac.ed.ph.jqtiplus.node.test.AssessmentSection) AssessmentItemRef(uk.ac.ed.ph.jqtiplus.node.test.AssessmentItemRef)

Aggregations

SectionPart (uk.ac.ed.ph.jqtiplus.node.test.SectionPart)12 AssessmentItemRef (uk.ac.ed.ph.jqtiplus.node.test.AssessmentItemRef)10 AssessmentSection (uk.ac.ed.ph.jqtiplus.node.test.AssessmentSection)10 AssessmentItem (uk.ac.ed.ph.jqtiplus.node.item.AssessmentItem)6 ResolvedAssessmentItem (uk.ac.ed.ph.jqtiplus.resolution.ResolvedAssessmentItem)6 GenericTreeNode (org.olat.core.gui.components.tree.GenericTreeNode)4 File (java.io.File)2 URI (java.net.URI)2 DoubleAdder (java.util.concurrent.atomic.DoubleAdder)2 TreeNode (org.olat.core.gui.components.tree.TreeNode)2 AssessmentTestVisitor (org.olat.ims.qti21.AssessmentTestHelper.AssessmentTestVisitor)2 RubricBlock (uk.ac.ed.ph.jqtiplus.node.content.variable.RubricBlock)2 AssessmentTest (uk.ac.ed.ph.jqtiplus.node.test.AssessmentTest)2 TestPart (uk.ac.ed.ph.jqtiplus.node.test.TestPart)2 ResolvedAssessmentTest (uk.ac.ed.ph.jqtiplus.resolution.ResolvedAssessmentTest)2