Package org.olat.course.run.userview

Examples of org.olat.course.run.userview.TreeEvaluation


      ienv.setIdentity(identity);
      Roles roles = ManagerFactory.getManager().getRoles(identity);
      ienv.setRoles(roles);
      UserCourseEnvironment userCourseEnv = new UserCourseEnvironmentImpl(ienv, course.getCourseEnvironment());
      // Build an evaluation tree
      TreeEvaluation treeEval = new TreeEvaluation();
      NodeEvaluation nodeEval = node.eval(userCourseEnv.getConditionInterpreter(), treeEval);
      if (nodeEval.isVisible() && validAuthentication(identity, token)) {
        hasAccess = true;
      }
    }
View Full Code Here


    String nodeIdS = nodeId.toString();
    CourseNode courseNode = course.getRunStructure().getNode(nodeIdS);
    if (log.isDebug()) log.debug("courseNode=" + courseNode );
   
    TreeEvaluation treeEval = new TreeEvaluation();
    NodeEvaluation rootNodeEval = rootCn.eval(userCourseEnv.getConditionInterpreter(), treeEval);
    if (log.isDebug()) log.debug("rootNodeEval=" + rootNodeEval );

    TreeNode newCalledTreeNode = treeEval.getCorrespondingTreeNode(courseNode);
    if (newCalledTreeNode == null) {
      // TreeNode no longer visible
      return false;
    }
    // go further
View Full Code Here

      // course
      ICourse course = CourseFactory.loadCourse(repositoryEntry.getOlatResource());
      CourseNode rootNode = course.getRunStructure().getRootNode();
      UserCourseEnvironmentImpl uce = new UserCourseEnvironmentImpl(ureq.getUserSession().getIdentityEnvironment(), course
          .getCourseEnvironment());
      NodeEvaluation nodeEval = rootNode.eval(uce.getConditionInterpreter(), new TreeEvaluation());
      boolean mayAccessWholeTreeUp = NavigationHandler.mayAccessWholeTreeUp(nodeEval);
      if (!mayAccessWholeTreeUp || !nodeEval.isVisible()) {
        String explan = rootNode.getNoAccessExplanation();
        String sExplan = (explan == null ? translate("launch.noaccess") : Formatter.formatLatexFormulas(explan));
        main.contextPut("disabledlaunchreason", sExplan);
View Full Code Here

    if (log.isDebug()){
      log.debug("evaluateJumpTo courseNode = " + courseNode.getIdent() + ", " + courseNode.getShortName());
    }

    // build the new treemodel by evaluating the preconditions
    TreeEvaluation treeEval = new TreeEvaluation();
    GenericTreeModel treeModel = new GenericTreeModel();
    CourseNode rootCn = userCourseEnv.getCourseEnvironment().getRunStructure().getRootNode();
    NodeEvaluation rootNodeEval = rootCn.eval(userCourseEnv.getConditionInterpreter(), treeEval);
    TreeNode treeRoot = rootNodeEval.getTreeNode();
    treeModel.setRootNode(treeRoot);

    // find the treenode that corresponds to the node (!= selectedTreeNode since
    // we built the TreeModel anew in the meantime
    TreeNode newCalledTreeNode = treeEval.getCorrespondingTreeNode(courseNode);
    if (newCalledTreeNode == null) {
      // the clicked node is not visible anymore!
      // if the new calculated model does not contain the selected node anymore
      // (because of visibility changes of at least one of the ancestors
      // -> issue an user infomative msg
View Full Code Here

TOP

Related Classes of org.olat.course.run.userview.TreeEvaluation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.