use of org.olat.core.gui.components.tree.GenericTreeModel in project openolat by klemens.
the class QTI21StatisticResourceResult method getTreeModel.
/**
* Return the tree model for a test learn resource.
*
* @return
*/
public TreeModel getTreeModel() {
GenericTreeModel treeModel = new GenericTreeModel();
GenericTreeNode rootTreeNode = new GenericTreeNode();
treeModel.setRootNode(rootTreeNode);
FileResourceManager frm = FileResourceManager.getInstance();
File unzippedDirRoot = frm.unzipFileResource(testEntry.getOlatResource());
resolvedAssessmentTest = qtiService.loadAndResolveAssessmentTest(unzippedDirRoot, false, false);
AssessmentTest test = resolvedAssessmentTest.getTestLookup().getRootNodeHolder().getRootNode();
rootTreeNode.setTitle(test.getTitle());
rootTreeNode.setUserObject(test);
rootTreeNode.setIconCssClass("o_icon o_icon-lg o_qtiassessment_icon");
buildRecursively(test, rootTreeNode);
return treeModel;
}
use of org.olat.core.gui.components.tree.GenericTreeModel in project openolat by klemens.
the class CoachMainController method buildTreeModel.
private TreeModel buildTreeModel(UserRequest ureq) {
GenericTreeModel gtm = new GenericTreeModel();
GenericTreeNode root = new GenericTreeNode();
gtm.setRootNode(root);
GenericTreeNode students = new GenericTreeNode();
students.setUserObject("Members");
students.setTitle(translate("students.menu.title"));
students.setAltText(translate("students.menu.title.alt"));
root.addChild(students);
GenericTreeNode groups = new GenericTreeNode();
groups.setUserObject("Groups");
groups.setTitle(translate("groups.menu.title"));
groups.setAltText(translate("groups.menu.title.alt"));
root.addChild(groups);
GenericTreeNode courses = new GenericTreeNode();
courses.setUserObject("Courses");
courses.setTitle(translate("courses.menu.title"));
courses.setAltText(translate("courses.menu.title.alt"));
root.addChild(courses);
if (lectureModule.isEnabled()) {
GenericTreeNode lectures = new GenericTreeNode();
lectures.setUserObject("Lectures");
lectures.setTitle(translate("lectures.menu.title"));
lectures.setAltText(translate("courses.menu.title.alt"));
root.addChild(lectures);
}
Roles roles = ureq.getUserSession().getRoles();
if (roles.isUserManager() || roles.isOLATAdmin()) {
GenericTreeNode search = new GenericTreeNode();
search.setUserObject("Search");
search.setTitle(translate("search.menu.title"));
search.setAltText(translate("search.menu.title.alt"));
root.addChild(search);
}
return gtm;
}
Aggregations