Package org.olat.course.nodes

Examples of org.olat.course.nodes.AssessableCourseNode


      nodeData.put(KEY_TITLE_SHORT, courseNode.getShortTitle());
      nodeData.put(KEY_TITLE_LONG, courseNode.getLongTitle());
      nodeData.put(KEY_IDENTIFYER, courseNode.getIdent());
     
      if (courseNode instanceof AssessableCourseNode) {
        AssessableCourseNode assessableCourseNode = (AssessableCourseNode) courseNode;
        ScoreEvaluation scoreEvaluation = userCourseEnv.getScoreAccounting().getScoreEvaluation(courseNode);
        // details
        if (assessableCourseNode.hasDetails()) {
          hasDisplayableValuesConfigured = true;
          String detailValue = assessableCourseNode.getDetailsListView(userCourseEnv);
          if (detailValue == null) {
            // ignore unset details in discardEmptyNodes mode
            nodeData.put(KEY_DETAILS, AssessmentHelper.DETAILS_NA_VALUE);
          } else {
            nodeData.put(KEY_DETAILS, detailValue);
            hasDisplayableUserValues = true;
          }
        }
        // attempts
        if (assessableCourseNode.hasAttemptsConfigured()) {
          hasDisplayableValuesConfigured = true;
          Integer attemptsValue = assessableCourseNode.getUserAttempts(userCourseEnv);
          if (attemptsValue != null) {
            nodeData.put(KEY_ATTEMPTS, attemptsValue);
            if (attemptsValue.intValue() > 0) {
                // ignore attempts = 0  in discardEmptyNodes mode
                hasDisplayableUserValues = true;
            }
          }
        }
        // score
        if (assessableCourseNode.hasScoreConfigured()) {
          hasDisplayableValuesConfigured = true;
          Float score = scoreEvaluation.getScore();
          if (score != null) {
            nodeData.put(KEY_SCORE, AssessmentHelper.getRoundedScore(score));
            hasDisplayableUserValues = true;
          }
        }
        // passed
        if (assessableCourseNode.hasPassedConfigured()) {
          hasDisplayableValuesConfigured = true;
          Boolean passed = scoreEvaluation.getPassed();
          if (passed != null) {
            nodeData.put(KEY_PASSED, passed);
            hasDisplayableUserValues = true;
          }
        }
        // selection command available
        AssessableCourseNode acn = (AssessableCourseNode) courseNode;
        if (acn.isEditableConfigured()) {
          // Assessable course nodes are selectable
          nodeData.put(KEY_SELECTABLE, Boolean.TRUE);
        } else {
          // assessable nodes that do not have score or passed are not selectable
          // (e.g. a st node with no defined rule
View Full Code Here


   * @return The score evaluation
   */
  public ScoreEvaluation getScoreEvaluation(CourseNode courseNode) {
    ScoreEvaluation se = null;
    if (courseNode instanceof AssessableCourseNode) {
      AssessableCourseNode acn = (AssessableCourseNode) courseNode;
      se = acn.getUserScoreEvaluation(userCourseEnvironment);
    }
    return se;
  }
View Full Code Here

      error = true;
      childNotOfAssessableTypeError = true;
      wrongChildID = childId;
      return new Float(-1111111.0f);
    }
    AssessableCourseNode acn = (AssessableCourseNode) foundNode;
    ScoreEvaluation se = evalCourseNode(acn);
    if (se == null) { // the node could not provide any sensible information on scoring. e.g. a STNode with no calculating rules
      String msg = "could not evaluate node " + acn.getShortTitle() + " (" + acn.getIdent() + ")" + "; called by node "
          + (evaluatingCourseNode == null ? "n/a" : evaluatingCourseNode.getShortTitle() + " (" + evaluatingCourseNode.getIdent() + ")");
      new OLATRuntimeException(ScoreAccounting.class, "scoreaccounting.evaluationerror.score",
          new String[]{acn.getIdent(), acn.getShortTitle()},
          Util.getPackageName(ScoreAccounting.class),
          msg, null);
    }
    Float score = se.getScore();
    if (score == null) { // a child has no score yet
View Full Code Here

      error = true;
      childNotOfAssessableTypeError = true;
      wrongChildID = childId;
      return Boolean.FALSE;
    }
    AssessableCourseNode acn = (AssessableCourseNode) foundNode;
    ScoreEvaluation se = evalCourseNode(acn);
    if (se == null) { // the node could not provide any sensible information on scoring. e.g. a STNode with no calculating rules
      String msg = "could not evaluate node '" + acn.getShortTitle() + "' (" + acn.getClass().getName() + "," + childId + ")";
      new OLATRuntimeException(ScoreAccounting.class, "scoreaccounting.evaluationerror.score",
          new String[]{acn.getIdent(), acn.getShortTitle()},
          Util.getPackageName(ScoreAccounting.class),
          msg, null);
    }
    Boolean passed = se.getPassed();
    if (passed == null) { // a child has no "Passed" yet
View Full Code Here

   * @see org.olat.core.util.tree.Visitor#visit(org.olat.core.util.nodes.INode)
   */
  public void visit(INode node) {
    CourseNode cn = (CourseNode) node;
    if (cn instanceof AssessableCourseNode) {
      AssessableCourseNode acn = (AssessableCourseNode) cn;
      evalCourseNode(acn);
      // evalCourseNode will cache all infos
    }
    // else: non assessable nodes are not interesting here
  }
View Full Code Here

      uce.getScoreAccounting().evaluateAll();
      AssessmentManager am = course.getCourseEnvironment().getAssessmentManager();

      Iterator iterNodes = myNodes.iterator();
      while (iterNodes.hasNext()) {
        AssessableCourseNode acnode = (AssessableCourseNode) iterNodes.next();
        boolean scoreOk = acnode.hasScoreConfigured();
        boolean passedOk = acnode.hasPassedConfigured();
        boolean attemptsOk = acnode.hasAttemptsConfigured();
        boolean commentOk = acnode.hasCommentConfigured();

        if (scoreOk || passedOk || commentOk || attemptsOk) {
          ScoreEvaluation se = uce.getScoreAccounting().getScoreEvaluation(acnode);
          boolean nodeColumnOk = false;
          StringBuilder tabs = new StringBuilder();

          if (scoreOk) {
            Float score = se.getScore();
            nodeColumnOk = true;
            tabs.append("\t"); // tabulators for header1 after node title

            if (firstIteration) {
              tableHeader2.append(sc);
              tableHeader2.append("\t");
            }

            if (score != null) {
              tableContent.append(AssessmentHelper.getRoundedScore(score));
              tableContent.append("\t");
            } else { // score == null
              tableContent.append(mi);
              tableContent.append("\t");
            }
          }

          if (passedOk) {
            Boolean passed = se.getPassed();
            nodeColumnOk = true;
            tabs.append("\t"); // tabulators for header1 after node title

            if (firstIteration) {
              tableHeader2.append(pa);
              tableHeader2.append("\t");
            }

            if (passed != null) {
              String yesno;
              if (passed.booleanValue()) {
                yesno = yes;
              } else {
                yesno = no;
              }
              tableContent.append(yesno);
              tableContent.append("\t");
            } else { // passed == null
              tableContent.append(mi);
              tableContent.append("\t");
            }
          }

          if (attemptsOk) {
            Integer attempts = am.getNodeAttempts(acnode, identity);
            int a = attempts.intValue();
            nodeColumnOk = true;
            tabs.append("\t"); // tabulators for header1 after node title

            if (firstIteration) {
              tableHeader2.append(at);
              tableHeader2.append("\t");
            }

            tableContent.append(a);
            tableContent.append("\t");
          }

          if (commentOk) {
              // Comments for user
            String comment = am.getNodeComment(acnode, identity);
            nodeColumnOk = true;
            tabs.append("\t"); // tabulators for header1 after node title

            if (firstIteration) {
              tableHeader2.append(co);
              tableHeader2.append("\t");
            }

            if (comment != null) {
              // put comment between double quote in order to prevent that
              // '\t','\r' or '\n' destroy the excel table
              tableContent.append("\"");
              tableContent.append(comment);
              tableContent.append("\"\t");
            } else {
              tableContent.append(mi);
              tableContent.append("\t");
            }
           
            // Comments for tutors
            String coachComment = am.getNodeCoachComment(acnode, identity);
            tabs.append("\t"); // tabulators for header1 after node title

            if (firstIteration) {
              tableHeader2.append(cco);
              tableHeader2.append("\t");
            }

            if (coachComment != null) {
              // put coachComment between double quote in order to prevent that
              // '\t','\r' or '\n' destroy the excel table
              tableContent.append("\"");
              tableContent.append(coachComment);
              tableContent.append("\"\t");
            } else {
              tableContent.append(mi);
              tableContent.append("\t");
            }
           
           
          }

          if (firstIteration && nodeColumnOk) {
            String shortTitle = acnode.getShortTitle();

            tableHeader1.append(shortTitle);
            tableHeader1.append(tabs.toString());
          }
View Full Code Here

      nodeData.put(AssessmentHelper.KEY_TITLE_SHORT, courseNode.getShortTitle());
      nodeData.put(AssessmentHelper.KEY_TITLE_LONG, courseNode.getLongTitle());
      nodeData.put(AssessmentHelper.KEY_IDENTIFYER, courseNode.getIdent());
     
      if (courseNode instanceof AssessableCourseNode) {
        AssessableCourseNode assessableCourseNode = (AssessableCourseNode) courseNode;
        if ( assessableCourseNode.hasDetails()
          || assessableCourseNode.hasAttemptsConfigured()
          || assessableCourseNode.hasScoreConfigured()
          || assessableCourseNode.hasPassedConfigured()
          || assessableCourseNode.hasCommentConfigured()) {
          hasDisplayableValuesConfigured = true;
        }
        if (assessableCourseNode.isEditableConfigured()) {
          // Assessable course nodes are selectable when they are aditable
          nodeData.put(AssessmentHelper.KEY_SELECTABLE, Boolean.TRUE);
        } else if (courseNode instanceof STCourseNode
            && (assessableCourseNode.hasScoreConfigured()
            || assessableCourseNode.hasPassedConfigured())) {
          // st node is special case: selectable on node choose list as soon as it
          // has score or passed
          nodeData.put(AssessmentHelper.KEY_SELECTABLE, Boolean.TRUE);
        } else {
          // assessable nodes that do not have score or passed are not selectable
View Full Code Here

   * @return List of course Nodes
   */
  private List addAssessableNodesToList(CourseNode courseNode, BusinessGroup group) {
    List result = new ArrayList();   
    if (courseNode instanceof AssessableCourseNode) {
      AssessableCourseNode assessableCourseNode = (AssessableCourseNode) courseNode;
      if ( assessableCourseNode.hasDetails()
        || assessableCourseNode.hasAttemptsConfigured()
        || assessableCourseNode.hasScoreConfigured()
        || assessableCourseNode.hasPassedConfigured()
        || assessableCourseNode.hasCommentConfigured()) {
        if ( !isFiltering || isVisibleAndAccessable(assessableCourseNode,group) ) {
          result.add(assessableCourseNode);
        }
      }
    }
View Full Code Here

   * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
   */
  public void event(UserRequest ureq, Controller source, Event event) {
    if (source == assessmentOverviewCtr) {
      if (event.equals(IdentityAssessmentOverviewController.EVENT_NODE_SELECTED)) {
        AssessableCourseNode courseNode = assessmentOverviewCtr.getSelectedCourseNode();
        doEditNodeAssessment(ureq, courseNode);
      }
    }
    else if (source == assessmentEditCtr) {
      if (event.equals(Event.CANCELLED_EVENT)) {
View Full Code Here

    Formatter f = Formatter.getInstance(ureq.getLocale());
    c.put("date", f.formatDate(now));
    c.put("time", f.formatTime(now));
   
    // update attempts counter for this user: one file - one attempts
    AssessableCourseNode acn = (AssessableCourseNode) node;
    acn.incrementUserAttempts(userCourseEnv);
       
    // log entry for this file
    UserNodeAuditManager am = userCourseEnv.getCourseEnvironment().getAuditManager();
    am.appendToUserNodeLog(node, identity, identity, "FILE UPLOADED: " + filename);
View Full Code Here

TOP

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

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.