Search in sources :

Example 26 with AssessmentSection

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

the class AssessmentTestEditorAndComposerTreeModel method buildRecursively.

private void buildRecursively(TestPart part, int pos, TreeNode parentNode) {
    GenericTreeNode partNode = new GenericTreeNode(part.getIdentifier().toString());
    partNode.setTitle(pos + ". Test part");
    partNode.setIconCssClass("o_icon o_qtiassessment_icon");
    partNode.setUserObject(part);
    parentNode.addChild(partNode);
    List<AssessmentSection> sections = part.getAssessmentSections();
    for (AssessmentSection section : sections) {
        buildRecursively(section, partNode);
    }
}
Also used : GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) AssessmentSection(uk.ac.ed.ph.jqtiplus.node.test.AssessmentSection)

Example 27 with AssessmentSection

use of uk.ac.ed.ph.jqtiplus.node.test.AssessmentSection in project OpenOLAT by OpenOLAT.

the class QTI21ArchiveFormat method collectElementInfos.

private void collectElementInfos(AssessmentSection section) {
    numOfSections++;
    SectionInfos sectionInfos = new SectionInfos(section);
    elementInfos.add(sectionInfos);
    List<SectionPart> parts = section.getChildAbstractParts();
    for (SectionPart part : parts) {
        if (part instanceof AssessmentItemRef) {
            AssessmentItemRef itemRef = (AssessmentItemRef) part;
            ResolvedAssessmentItem resolvedItem = resolvedAssessmentTest.getResolvedAssessmentItem(itemRef);
            AssessmentItem item = resolvedItem.getRootNodeLookup().extractIfSuccessful();
            if (item != null) {
                ItemInfos itemInfo = new ItemInfos(itemRef, item, item.getItemBody().findInteractions());
                elementInfos.add(itemInfo);
                sectionInfos.getItemInfos().add(itemInfo);
            }
        } else if (part instanceof AssessmentSection) {
            collectElementInfos((AssessmentSection) part);
        }
    }
}
Also used : SectionPart(uk.ac.ed.ph.jqtiplus.node.test.SectionPart) ResolvedAssessmentItem(uk.ac.ed.ph.jqtiplus.resolution.ResolvedAssessmentItem) AssessmentSection(uk.ac.ed.ph.jqtiplus.node.test.AssessmentSection) AssessmentItemRef(uk.ac.ed.ph.jqtiplus.node.test.AssessmentItemRef) ResolvedAssessmentItem(uk.ac.ed.ph.jqtiplus.resolution.ResolvedAssessmentItem) AssessmentItem(uk.ac.ed.ph.jqtiplus.node.item.AssessmentItem)

Example 28 with AssessmentSection

use of uk.ac.ed.ph.jqtiplus.node.test.AssessmentSection in project OpenOLAT by OpenOLAT.

the class AssessmentTestHelper method needManualCorrection.

public static boolean needManualCorrection(ResolvedAssessmentTest resolvedAssessmentTest) {
    AssessmentTest test = resolvedAssessmentTest.getRootNodeLookup().extractIfSuccessful();
    boolean needManualCorrection = false;
    List<TestPart> parts = test.getChildAbstractParts();
    for (TestPart part : parts) {
        List<AssessmentSection> sections = part.getAssessmentSections();
        for (AssessmentSection section : sections) {
            if (needManualCorrection(section, resolvedAssessmentTest)) {
                needManualCorrection = true;
                break;
            }
        }
    }
    return needManualCorrection;
}
Also used : ResolvedAssessmentTest(uk.ac.ed.ph.jqtiplus.resolution.ResolvedAssessmentTest) AssessmentTest(uk.ac.ed.ph.jqtiplus.node.test.AssessmentTest) AssessmentSection(uk.ac.ed.ph.jqtiplus.node.test.AssessmentSection) TestPart(uk.ac.ed.ph.jqtiplus.node.test.TestPart)

Example 29 with AssessmentSection

use of uk.ac.ed.ph.jqtiplus.node.test.AssessmentSection in project OpenOLAT by OpenOLAT.

the class AssessmentTestHelper method visit.

/**
 * Go through the assessmentTest, visit recursively its test parts, sections and
 * assessment item refs.
 *
 * @param assessmentTest The assessment test to visit
 * @param visitor The visitor
 */
public static void visit(AssessmentTest assessmentTest, AssessmentTestVisitor visitor) {
    List<TestPart> testParts = assessmentTest.getTestParts();
    if (testParts != null && testParts.size() > 0) {
        for (TestPart testPart : testParts) {
            visitor.visit(testPart);
            List<AssessmentSection> sections = testPart.getAssessmentSections();
            if (sections != null && sections.size() > 0) {
                for (AssessmentSection section : sections) {
                    visit(section, visitor);
                }
            }
        }
    }
}
Also used : AssessmentSection(uk.ac.ed.ph.jqtiplus.node.test.AssessmentSection) TestPart(uk.ac.ed.ph.jqtiplus.node.test.TestPart)

Example 30 with AssessmentSection

use of uk.ac.ed.ph.jqtiplus.node.test.AssessmentSection in project OpenOLAT by OpenOLAT.

the class AssessmentTestComponentRenderer method renderAssessmentSectionRubrickBlock.

private void renderAssessmentSectionRubrickBlock(AssessmentRenderer renderer, StringOutput sb, AssessmentTestComponent component, TestPlanNode sectionNode, URLBuilder ubu, Translator translator) {
    AssessmentSection selectedSection = component.getAssessmentSection(sectionNode.getIdentifier());
    if (selectedSection != null && selectedSection.getRubricBlocks().size() > 0) {
        for (RubricBlock rubricBlock : selectedSection.getRubricBlocks()) {
            // @view (candidate)
            sb.append("<div class='rubric'>");
            rubricBlock.getBlocks().forEach((block) -> renderBlock(renderer, sb, component, null, null, block, ubu, translator));
            sb.append("</div>");
        }
    }
}
Also used : AssessmentSection(uk.ac.ed.ph.jqtiplus.node.test.AssessmentSection) RubricBlock(uk.ac.ed.ph.jqtiplus.node.content.variable.RubricBlock)

Aggregations

AssessmentSection (uk.ac.ed.ph.jqtiplus.node.test.AssessmentSection)62 AssessmentItemRef (uk.ac.ed.ph.jqtiplus.node.test.AssessmentItemRef)28 GenericTreeNode (org.olat.core.gui.components.tree.GenericTreeNode)26 TestPart (uk.ac.ed.ph.jqtiplus.node.test.TestPart)26 TreeNode (org.olat.core.gui.components.tree.TreeNode)22 File (java.io.File)20 AssessmentItem (uk.ac.ed.ph.jqtiplus.node.item.AssessmentItem)20 AssessmentTest (uk.ac.ed.ph.jqtiplus.node.test.AssessmentTest)20 ResolvedAssessmentItem (uk.ac.ed.ph.jqtiplus.resolution.ResolvedAssessmentItem)20 URISyntaxException (java.net.URISyntaxException)16 ResolvedAssessmentTest (uk.ac.ed.ph.jqtiplus.resolution.ResolvedAssessmentTest)14 IOException (java.io.IOException)12 URI (java.net.URI)12 RubricBlock (uk.ac.ed.ph.jqtiplus.node.content.variable.RubricBlock)12 ManifestMetadataBuilder (org.olat.ims.qti21.model.xml.ManifestMetadataBuilder)10 SectionPart (uk.ac.ed.ph.jqtiplus.node.test.SectionPart)10 FileOutputStream (java.io.FileOutputStream)8 ManifestBuilder (org.olat.ims.qti21.model.xml.ManifestBuilder)8 ArrayList (java.util.ArrayList)6 QuestionItemFull (org.olat.modules.qpool.QuestionItemFull)6