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);
}
}
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);
}
}
}
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;
}
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);
}
}
}
}
}
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>");
}
}
}
Aggregations