Package org.olat.course.nodes

Examples of org.olat.course.nodes.CourseNode


 
  private Map<String, Object> getIndentednodeRendererMap(int row) {
    if (row>=orderedNodesList_.size()) {
      throw new IllegalStateException("row count too big: "+row+", only having "+orderedNodesList_.size()+" elements");
    }
    CourseNode node = orderedNodesList_.get(row);
    int recursionLevel = 0;
    INode parent = node.getParent();
    while(parent!=null) {
      recursionLevel++;
      parent = parent.getParent();
    }
   
    // Store node data in hash map. This hash map serves as data model for
    // the user assessment overview table. Leave user data empty since not used in
    // this table. (use only node data)
    Map<String,Object> nodeData = new HashMap<String, Object>();
    // indent
    nodeData.put(AssessmentHelper.KEY_INDENT, new Integer(recursionLevel));
    // course node data
    nodeData.put(AssessmentHelper.KEY_TYPE, node.getType());
    nodeData.put(AssessmentHelper.KEY_TITLE_SHORT, node.getShortTitle());
    nodeData.put(AssessmentHelper.KEY_TITLE_LONG, node.getLongTitle());
    nodeData.put(AssessmentHelper.KEY_IDENTIFYER, node.getIdent());
    // plus the node
    nodeData.put(StatisticResult.KEY_NODE, node);
     
    return nodeData;
  }
View Full Code Here


    }
    if (col==0) {
      return getIndentednodeRendererMap(row);
    }
   
    CourseNode node = orderedNodesList_.get(row);
    Map<String, Integer> statisticMap = statistic_.get(node);
    if (col-1>=columnHeaders_.size()) {
      // that's the total
      int total = 0;
      if (statisticMap!=null) {
View Full Code Here

   * @param nodeId
   * @return the course node
   */
  public CourseNode getCourseNode(String nodeId) {
    CourseEditorTreeNode ctn = (CourseEditorTreeNode) getNodeById(nodeId);
    CourseNode cn = ctn.getCourseNode();
    return cn;
  }
View Full Code Here

  /**
   * @return a deep clone of the current (run) structure of this editortreemodel
   */
  public Structure createStructureForPreview() {
    CourseEditorTreeNode cetn = (CourseEditorTreeNode) getRootNode();
    CourseNode clone = buildUp(cetn);
    Structure structure = new Structure();
    structure.setRootNode(clone);
    return structure;
  }
View Full Code Here

    structure.setRootNode(clone);
    return structure;
  }

  private CourseNode buildUp(CourseEditorTreeNode cetn) {
    CourseNode attachedNode = cetn.getCourseNode();
    // clone current
    CourseNode cloneCn = (CourseNode) ObjectCloner.deepCopy(attachedNode);
    // visit all children
    int chdCnt = cetn.getChildCount();
    for (int i = 0; i < chdCnt; i++) {
      CourseEditorTreeNode child = cetn.getCourseEditorTreeNodeChildAt(i);
      // only add if not deleted and configuration is valid
      if (!child.isDeleted() && !(child.getCourseNode().isConfigValid().isError())) {
        CourseNode res = buildUp(child);
        cloneCn.addChild(res);
      }
    }
    return cloneCn;
View Full Code Here

   *          coursenode is selected
   * @param listeningController
   */
  public NodeClickedRef evaluateJumpToCourseNode(UserRequest ureq, WindowControl wControl, CourseNode calledCourseNode,
      ControllerEventListener listeningController, String nodecmd) {
    CourseNode cn;
    if (calledCourseNode == null) {
      // indicate to jump to root course node
      cn = userCourseEnv.getCourseEnvironment().getRunStructure().getRootNode();
    } else {
      cn = calledCourseNode;
View Full Code Here

      // normal dispatching to a coursenode.
      // get the courseNode that was called
      NodeEvaluation prevEval = (NodeEvaluation) selTN.getUserObject();
      if (!prevEval.isVisible()) throw new AssertException("clicked on a node which is not visible: treenode=" + selTN.getIdent() + ", "
          + selTN.getTitle());
      CourseNode calledCourseNode = prevEval.getCourseNode();
      ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrap(calledCourseNode));
      ncr = doEvaluateJumpTo(ureq, wControl, calledCourseNode, listeningController, nodecmd);
    }
    return ncr;
View Full Code Here

    }

    // 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
View Full Code Here

    return tp;
  }

  public CourseNode getCourseNode(TreeNode tn) {
    CourseEditorTreeNode ctn = (CourseEditorTreeNode) tn;
    CourseNode cn = ctn.getCourseNode();
    return cn;
  }
View Full Code Here

   
    Object o = tableCtr_.getTableDataModel().getValueAt(rowId, 0);
    String selectionInfo = "";
    if (o instanceof Map) {
      Map map = (Map)o;
      CourseNode node = (CourseNode) map.get(StatisticResult.KEY_NODE);
      ThreadLocalUserActivityLogger.log(StatisticLoggingAction.VIEW_NODE_STATISTIC, getClass(),
          LoggingResourceable.wrap(node),
          LoggingResourceable.wrapNonOlatResource(StringResourceableType.statisticType, "", STATISTIC_TYPE_VIEW_NODE_STATISTIC));
      selectionInfo = getTranslator().translate("statistic.chart.selectioninfo.node", new String[] { (String) map.get(AssessmentHelper.KEY_TITLE_SHORT) });
    } else {
View Full Code Here

TOP

Related Classes of org.olat.course.nodes.CourseNode

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.