Package org.olat.course.nodes

Examples of org.olat.course.nodes.CourseNode


      /**
       * collect only status descriptions of not deleted nodes
       */
      CourseEditorTreeNode tmp = (CourseEditorTreeNode) node;
      if (!tmp.isDeleted()) {
        CourseNode cn = tmp.getCourseNode();
        String key = cn.getIdent();
        StatusDescription[] allSds = cn.isConfigValid(cev);
        if (allSds.length > 0) {
          for (int i = 0; i < allSds.length; i++) {
            StatusDescription sd = allSds[i];
            if (sd != StatusDescription.NOERROR) {
              if (!statusDescs.containsKey(key)) {
View Full Code Here


    public void visit(INode node) {
      /**
       * collect condition expressions only for not deleted nodes
       */
      CourseEditorTreeNode tmp = (CourseEditorTreeNode) node;
      CourseNode cn = tmp.getCourseNode();
      String key = cn.getIdent();
      List condExprs = cn.getConditionExpressions();
      if (condExprs.size() > 0 && !tmp.isDeleted()) {
        // evaluate each expression
        for (Iterator iter = condExprs.iterator(); iter.hasNext();) {
          ConditionExpression ce = (ConditionExpression) iter.next();
          currentCourseNodeId = key;
View Full Code Here

      final boolean logDebug = log.isDebug();
      final Identity identity = userCourseEnv.getIdentityEnvironment().getIdentity();
      final PropertyManager pm = PropertyManager.getInstance();         
      final String courseRepoEntryKey = getPropertyName(repoEntryKey);         
       
      CourseNode rootNode = userCourseEnv.getCourseEnvironment().getRunStructure().getRootNode();
      List<Map<String,Object>> assessmentNodes = AssessmentHelper.addAssessableNodeAndDataToList(0, rootNode, userCourseEnv, true, true);
         
      EfficiencyStatement efficiencyStatement = new EfficiencyStatement();
      efficiencyStatement.setAssessmentNodes(assessmentNodes);
      efficiencyStatement.setCourseTitle(userCourseEnv.getCourseEnvironment().getCourseTitle());
View Full Code Here

        String actionid = te.getActionId();
        if (actionid.equals(CMD_SELECT_NODE)) {
          ICourse course = CourseFactory.loadCourse(ores);
          int rowid = te.getRowId();
          Map<String,Object> nodeData = (Map<String,Object>) nodeTableModel.getObject(rowid);
          CourseNode node = course.getRunStructure().getNode((String) nodeData.get(AssessmentHelper.KEY_IDENTIFYER));
          this.currentCourseNode = (AssessableCourseNode) node;
          // cast should be save, only assessable nodes are selectable
          doGroupChoose(ureq);
        }
      } else if (event.equals(TableController.EVENT_FILTER_SELECTED)) {
View Full Code Here

        null, ureq.getLocale(), ColumnDescriptor.ALIGNMENT_LEFT, new IndentedNodeRenderer()));
    nodeListCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.action.select", 1,
        CMD_SELECT_NODE, ureq.getLocale()));
   
    // get list of course node data and populate table data model
    CourseNode rootNode = course.getRunStructure().getRootNode();   
    List<Map<String, Object>> nodesTableObjectArrayList = addAssessableNodesAndParentsToList(0, rootNode);
   
    // only populate data model if data available
    if (nodesTableObjectArrayList == null) {
      String text = translate("nodesoverview.nonodes");
View Full Code Here

   */
  private List<Map<String, Object>> addAssessableNodesAndParentsToList(int recursionLevel, CourseNode courseNode) {
    // 1) Get list of children data using recursion of this method
    List<Map<String, Object>> childrenData = new ArrayList<Map<String, Object>>();
    for (int i = 0; i < courseNode.getChildCount(); i++) {
      CourseNode child = (CourseNode) courseNode.getChildAt(i);
      List<Map<String, Object>> childData = addAssessableNodesAndParentsToList( (recursionLevel + 1),  child);
      if (childData != null)
        childrenData.addAll(childData);
    }
   
View Full Code Here

          result.add(assessableCourseNode);
        }
      }
    }
    for (int i = 0; i < courseNode.getChildCount(); i++) {
      CourseNode child = (CourseNode) courseNode.getChildAt(i);
      result.addAll(addAssessableNodesToList(child, group));
    }
    return result;
  }
View Full Code Here

    if (scoreCalculator != null && selectedNodeList != null) {
      for (Iterator iter = selectedNodeList.iterator(); iter.hasNext();) {
        String nodeIdent = (String) iter.next();
        boolean found = false;
        for (Iterator nodeIter = allNodesList.iterator(); nodeIter.hasNext();) {
          CourseNode node = (CourseNode) nodeIter.next();
          if (node.getIdent().equals(nodeIdent)) {
            found = true;          
          }         
        }
        if (!found) addDeletedNodeIdent = true;
      }
    }

    String[] nodeKeys = new String[allNodesList.size() + (addDeletedNodeIdent ? 1 : 0)];
    String[] nodeValues = new String[allNodesList.size() + (addDeletedNodeIdent ? 1 : 0)];
    for (int i = 0; i < allNodesList.size(); i++) {
      CourseNode courseNode = (CourseNode) allNodesList.get(i);
      nodeKeys[i] = courseNode.getIdent();
      nodeValues[i] = courseNode.getShortName() + " (Id:" + courseNode.getIdent() + ")";
    }
    // add a deleted dummy node at last position
    if (addDeletedNodeIdent) {
      nodeKeys[allNodesList.size()] = DELETED_NODE_IDENTIFYER;
      nodeValues[allNodesList.size()] = translate("scform.deletedNode");
    }
    StaticMultipleSelectionElement mse = new StaticMultipleSelectionElement(elemId, nodeKeys, nodeValues, false);
    // preselect nodes from configuration
    if (scoreCalculator != null && selectedNodeList != null) {
      for (Iterator iter = selectedNodeList.iterator(); iter.hasNext();) {
        String nodeIdent = (String) iter.next();
        boolean found = false;
        for (Iterator nodeIter = allNodesList.iterator(); nodeIter.hasNext();) {
          CourseNode node = (CourseNode) nodeIter.next();
          if (node.getIdent().equals(nodeIdent)) {
            found = true;
          }
        }
        if (found) {
          mse.select(nodeIdent, true);
View Full Code Here

   */
  public List<String> getInvalidNodeDescriptions() {
    List<String> testElemWithNoResource = new ArrayList<String>();
    List<String> selectedNodesIds = new ArrayList<String>(scoreNodeIdents.getSelectedKeys());   
    for (Iterator nodeIter = assessableNodesList.iterator(); nodeIter.hasNext();) {
      CourseNode node = (CourseNode) nodeIter.next();
      if (selectedNodesIds.contains(node.getIdent())) {       
        StatusDescription isConfigValid = node.isConfigValid();
        if (isConfigValid != null && isConfigValid.isError()) {
          String nodeDescription = node.getShortName() + " (Id:" + node.getIdent() + ")";
          if (!testElemWithNoResource.contains(nodeDescription)) {
            testElemWithNoResource.add(nodeDescription);
          }
        }
      }
View Full Code Here

  private List<String> getInvalidNodeDescriptions(ConditionExpression ce) {
    List<String> nodeDescriptionList = new ArrayList<String>();
    if (ce != null) {
      Set<String> selectedNodesIds = ce.getSoftReferencesOf("courseNodeId");
      for (Iterator nodeIter = assessableNodesList.iterator(); nodeIter.hasNext();) {
        CourseNode node = (CourseNode) nodeIter.next();
        if (selectedNodesIds.contains(node.getIdent())) {
          StatusDescription isConfigValid = node.isConfigValid();
          if (isConfigValid != null && isConfigValid.isError()) {
            String nodeDescription = node.getShortName() + " (Id:" + node.getIdent() + ")";
            if (!nodeDescriptionList.contains(nodeDescription)) {
              nodeDescriptionList.add(nodeDescription);
            }
          }
        }
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.