use of org.olat.course.statistic.StatisticResourceNode in project OpenOLAT by OpenOLAT.
the class QTIStatisticResourceResult method getController.
public Controller getController(UserRequest ureq, WindowControl wControl, TooledStackedPanel stackPanel, TreeNode selectedNode, boolean printMode) {
if (selectedNode instanceof StatisticResourceNode) {
return createAssessmentController(ureq, wControl, stackPanel, printMode);
} else if (selectedNode instanceof SectionNode) {
return createAssessmentController(ureq, wControl, stackPanel, printMode);
} else if (selectedNode instanceof ItemNode) {
Section section = null;
INode sectionNode = selectedNode.getParent();
if (sectionNode instanceof SectionNode) {
section = (Section) ((SectionNode) sectionNode).getUserObject();
}
Item item = (Item) ((ItemNode) selectedNode).getUserObject();
return createItemController(ureq, wControl, section, item, printMode);
}
return null;
}
use of org.olat.course.statistic.StatisticResourceNode in project OpenOLAT by OpenOLAT.
the class QTI21StatisticResourceResult method getController.
public Controller getController(UserRequest ureq, WindowControl wControl, TooledStackedPanel stackPanel, TreeNode selectedNode, boolean printMode) {
if (selectedNode instanceof StatisticResourceNode) {
return createAssessmentController(ureq, wControl, stackPanel, printMode);
} else {
Object uobject = selectedNode.getUserObject();
if (uobject instanceof AssessmentItemRef) {
TreeNode parentNode = (TreeNode) selectedNode.getParent();
String sectionTitle = parentNode.getTitle();
return createAssessmentItemController(ureq, wControl, (AssessmentItemRef) uobject, sectionTitle, printMode);
} else if (uobject instanceof AssessmentTest) {
return createAssessmentController(ureq, wControl, stackPanel, printMode);
}
}
return null;
}
use of org.olat.course.statistic.StatisticResourceNode in project openolat by klemens.
the class QTI12PrintController method initView.
private void initView(UserRequest ureq, QTIStatisticResourceResult resourceResult) {
StatisticResourceNode rootNode = (StatisticResourceNode) resourceResult.getSubTreeModel().getRootNode();
ICourse course = CourseFactory.loadCourse(resourceResult.getCourseOres());
mainVC.contextPut("courseTitle", course.getCourseTitle());
String testTitle = resourceResult.getQTIRepositoryEntry().getDisplayname();
mainVC.contextPut("testTitle", testTitle);
int count = 0;
List<String> pageNames = new ArrayList<>();
Controller assessmentCtrl = resourceResult.getController(ureq, getWindowControl(), null, rootNode, true);
String pageName = "page" + count++;
mainVC.put(pageName, assessmentCtrl.getInitialComponent());
pageNames.add(pageName);
for (int i = 0; i < rootNode.getChildCount(); i++) {
INode sectionNode = rootNode.getChildAt(i);
for (int j = 0; j < sectionNode.getChildCount(); j++) {
TreeNode itemNode = (TreeNode) sectionNode.getChildAt(j);
Controller itemCtrl = resourceResult.getController(ureq, getWindowControl(), null, itemNode, true);
String itemPageName = "page" + count++;
mainVC.put(itemPageName, itemCtrl.getInitialComponent());
pageNames.add(itemPageName);
}
}
mainVC.contextPut("pageNames", pageNames);
}
use of org.olat.course.statistic.StatisticResourceNode in project openolat by klemens.
the class QTIStatisticResourceResult method getSubTreeModel.
@Override
public TreeModel getSubTreeModel() {
GenericTreeModel subTreeModel;
if (type == QTIType.onyx) {
subTreeModel = new GenericTreeModel();
StatisticResourceNode rootTreeNode = new StatisticResourceNode(courseNode, this);
subTreeModel.setRootNode(rootTreeNode);
} else if (qtiDocument == null) {
subTreeModel = null;
} else {
subTreeModel = new GenericTreeModel();
StatisticResourceNode rootTreeNode = new StatisticResourceNode(courseNode, this);
subTreeModel.setRootNode(rootTreeNode);
buildQTICourseNodeSubTree(qtiDocument, rootTreeNode);
}
return subTreeModel;
}
use of org.olat.course.statistic.StatisticResourceNode in project openolat by klemens.
the class QTI21StatisticResourceResult method getController.
public Controller getController(UserRequest ureq, WindowControl wControl, TooledStackedPanel stackPanel, TreeNode selectedNode, boolean printMode) {
if (selectedNode instanceof StatisticResourceNode) {
return createAssessmentController(ureq, wControl, stackPanel, printMode);
} else {
Object uobject = selectedNode.getUserObject();
if (uobject instanceof AssessmentItemRef) {
TreeNode parentNode = (TreeNode) selectedNode.getParent();
String sectionTitle = parentNode.getTitle();
return createAssessmentItemController(ureq, wControl, (AssessmentItemRef) uobject, sectionTitle, printMode);
} else if (uobject instanceof AssessmentTest) {
return createAssessmentController(ureq, wControl, stackPanel, printMode);
}
}
return null;
}
Aggregations