use of uk.ac.ed.ph.jqtiplus.utils.TreeWalkNodeHandler in project OpenOLAT by OpenOLAT.
the class AssessmentTestComposerController method doExportPool.
private void doExportPool() {
TreeNode selectedNode = menuTree.getSelectedNode();
if (selectedNode == null)
return;
AtomicInteger counter = new AtomicInteger();
Object uobject = selectedNode.getUserObject();
if (uobject instanceof AssessmentItemRef) {
doExportPool((AssessmentItemRef) uobject);
counter.incrementAndGet();
} else if (uobject instanceof QtiNode) {
QtiNode qtiNode = (QtiNode) uobject;
QueryUtils.walkTree(new TreeWalkNodeHandler() {
@Override
public boolean handleNode(QtiNode node) {
if (node instanceof AssessmentItemRef) {
doExportPool((AssessmentItemRef) node);
counter.incrementAndGet();
}
return true;
}
}, qtiNode);
}
if (counter.get() > 0) {
showInfo("export.qpool.successful", counter.toString());
}
}
use of uk.ac.ed.ph.jqtiplus.utils.TreeWalkNodeHandler in project openolat by klemens.
the class AssessmentTestComposerController method doExportPool.
private void doExportPool() {
TreeNode selectedNode = menuTree.getSelectedNode();
if (selectedNode == null)
return;
AtomicInteger counter = new AtomicInteger();
Object uobject = selectedNode.getUserObject();
if (uobject instanceof AssessmentItemRef) {
doExportPool((AssessmentItemRef) uobject);
counter.incrementAndGet();
} else if (uobject instanceof QtiNode) {
QtiNode qtiNode = (QtiNode) uobject;
QueryUtils.walkTree(new TreeWalkNodeHandler() {
@Override
public boolean handleNode(QtiNode node) {
if (node instanceof AssessmentItemRef) {
doExportPool((AssessmentItemRef) node);
counter.incrementAndGet();
}
return true;
}
}, qtiNode);
}
if (counter.get() > 0) {
showInfo("export.qpool.successful", counter.toString());
}
}
Aggregations