Search in sources :

Example 61 with GenericTreeModel

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;
}
Also used : ResolvedAssessmentTest(uk.ac.ed.ph.jqtiplus.resolution.ResolvedAssessmentTest) AssessmentTest(uk.ac.ed.ph.jqtiplus.node.test.AssessmentTest) FileResourceManager(org.olat.fileresource.FileResourceManager) GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) GenericTreeModel(org.olat.core.gui.components.tree.GenericTreeModel) File(java.io.File)

Example 62 with GenericTreeModel

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;
}
Also used : GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) GenericTreeModel(org.olat.core.gui.components.tree.GenericTreeModel) Roles(org.olat.core.id.Roles)

Aggregations

GenericTreeModel (org.olat.core.gui.components.tree.GenericTreeModel)62 GenericTreeNode (org.olat.core.gui.components.tree.GenericTreeNode)42 TreeNode (org.olat.core.gui.components.tree.TreeNode)20 CourseNode (org.olat.course.nodes.CourseNode)12 Extension (org.olat.core.extensions.Extension)10 GenericActionExtension (org.olat.core.extensions.action.GenericActionExtension)10 AssertException (org.olat.core.logging.AssertException)10 ArrayList (java.util.ArrayList)8 ActionExtension (org.olat.core.extensions.action.ActionExtension)8 Controller (org.olat.core.gui.control.Controller)8 WindowControl (org.olat.core.gui.control.WindowControl)8 Identity (org.olat.core.id.Identity)8 OLATResourceable (org.olat.core.id.OLATResourceable)8 STCourseNode (org.olat.course.nodes.STCourseNode)8 NodeEvaluation (org.olat.course.run.userview.NodeEvaluation)8 List (java.util.List)6 ExtManager (org.olat.core.extensions.ExtManager)6 TreeModel (org.olat.core.gui.components.tree.TreeModel)6 ControllerEventListener (org.olat.core.gui.control.ControllerEventListener)6 TitledWrapperController (org.olat.core.gui.control.generic.title.TitledWrapperController)6