Examples of ScoreEvaluation


Examples of org.olat.course.run.scoring.ScoreEvaluation

    AssessmentManager am = userCourseEnvironment.getCourseEnvironment().getAssessmentManager();
    Identity mySelf = userCourseEnvironment.getIdentityEnvironment().getIdentity();
    Boolean passed = am.getNodePassed(this, mySelf);
    Float score = am.getNodeScore(this, mySelf);   
    Long assessmentID = am.getAssessmentID(this, mySelf);   
    ScoreEvaluation se = new ScoreEvaluation(score, passed, assessmentID);
    return se;
  }
View Full Code Here

Examples of org.olat.course.run.scoring.ScoreEvaluation

   * @param coachIdentity The identity of the coach who changes the users values
   *          (will be written to the user node log)
   */
  protected void doUpdateAssessmentData(Identity coachIdentity) {
    UserCourseEnvironment userCourseEnvironment = assessedIdentityWrapper.getUserCourseEnvironment();
    ScoreEvaluation scoreEval = null;
    Float newScore = null;
    Boolean newPassed = null;
    //String userName = userCourseEnvironment.getIdentityEnvironment().getIdentity().getName();

    if (assessmentForm.isHasAttempts() && assessmentForm.isAttemptsDirty()) {
      this.courseNode.updateUserAttempts(new Integer(assessmentForm.getAttempts()), userCourseEnvironment, coachIdentity);
    }

    if (assessmentForm.isHasScore() && assessmentForm.isScoreDirty()) {
      newScore = new Float(assessmentForm.getScore());
      // Update properties in db later... see
      // courseNode.updateUserSocreAndPassed...
    }
   
    if (assessmentForm.isHasPassed()) {
      if (assessmentForm.getCut() != null && StringHelper.containsNonWhitespace(assessmentForm.getScore())) {
        newPassed = Float.parseFloat(assessmentForm.getScore()) >= assessmentForm.getCut().floatValue()
                  ? Boolean.TRUE : Boolean.FALSE;
      } else {
        //"passed" info was changed or not
        String selectedKeyString = assessmentForm.getPassed().getSelectedKey();
        if("true".equalsIgnoreCase(selectedKeyString) || "false".equalsIgnoreCase(selectedKeyString)) {
          newPassed = Boolean.valueOf(selectedKeyString);
        }
        else {
          // "undefined" was choosen
          newPassed = null;
        }       
      }
    }
    // Update score,passed properties in db
    scoreEval = new ScoreEvaluation(newScore, newPassed);
    this.courseNode.updateUserScoreEvaluation(scoreEval, userCourseEnvironment, coachIdentity, false);

    if (assessmentForm.isHasComment() && assessmentForm.isUserCommentDirty()) {
      String newComment = assessmentForm.getUserComment().getValue();
      // Update properties in db
View Full Code Here

Examples of org.olat.course.run.scoring.ScoreEvaluation

  public ScoreEvaluation getUserScoreEvaluation(UserCourseEnvironment userCourseEnv) {
    Identity identity = userCourseEnv.getIdentityEnvironment().getIdentity();
    long olatResourceId = userCourseEnv.getCourseEnvironment().getCourseResourceableId().longValue();
    QTIResultSet qTIResultSet = IQManager.getInstance().getLastResultSet(identity, olatResourceId, this.getIdent());
    if(qTIResultSet!=null) {
      ScoreEvaluation scoreEvaluation = new ScoreEvaluation(new Float(qTIResultSet.getScore()), new Boolean(qTIResultSet.getIsPassed()), new Long(qTIResultSet.getAssessmentID()));
      return scoreEvaluation;
    }
    return null;
  }
View Full Code Here

Examples of org.olat.course.run.scoring.ScoreEvaluation

    if (colName.equals(COL_NAME)) return identity.getName();
    else if (userPropertyNameList.contains(colName)) return identity.getUser().getProperty(colName, getLocale());   
    else if (colName.equals(COL_DETAILS)) return wrappedIdentity.getDetailsListView();
    else if (colName.equals(COL_ATTEMPTS)) return wrappedIdentity.getNodeAttempts();
    else if (colName.equals(COL_SCORE)) {
      ScoreEvaluation scoreEval = wrappedIdentity.getUserCourseEnvironment().getScoreAccounting().evalCourseNode(courseNode);
      if (scoreEval == null) scoreEval = new ScoreEvaluation(null, null);
      return AssessmentHelper.getRoundedScore(scoreEval.getScore());
    else if (colName.equals(COL_STATUS)) {
      return getStatusFor(courseNode, wrappedIdentity);
    }else if (colName.equals(COL_PASSED)) {
      ScoreEvaluation scoreEval = wrappedIdentity.getUserCourseEnvironment().getScoreAccounting().evalCourseNode(courseNode);
      if (scoreEval == null) scoreEval = new ScoreEvaluation(null, null);
      return scoreEval.getPassed();
    } else return "error";
  }
View Full Code Here

Examples of org.olat.course.run.scoring.ScoreEvaluation

    Float score = null;
    // only db lookup if configured, else return null
    if (hasPassedConfigured()) passed = am.getNodePassed(this, mySelf);
    if (hasScoreConfigured()) score = am.getNodeScore(this, mySelf);

    ScoreEvaluation se = new ScoreEvaluation(score, passed);
    return se;
  }
View Full Code Here

Examples of org.olat.course.run.scoring.ScoreEvaluation

   */
  public void updateUserScoreEvaluation(ScoreEvaluation scoreEvaluation, UserCourseEnvironment userCourseEnvironment,
      Identity coachingIdentity, boolean incrementAttempts) {
    AssessmentManager am = userCourseEnvironment.getCourseEnvironment().getAssessmentManager();
    Identity mySelf = userCourseEnvironment.getIdentityEnvironment().getIdentity();
    am.saveScoreEvaluation(this, coachingIdentity, mySelf, new ScoreEvaluation(scoreEvaluation.getScore(), scoreEvaluation.getPassed()), userCourseEnvironment, incrementAttempts);   
  }
View Full Code Here

Examples of org.olat.course.run.scoring.ScoreEvaluation

        // Save results in case of test
        if (type.equals(AssessmentInstance.QMD_ENTRY_TYPE_ASSESS)) {
          // update scoring overview for the user in the current course
          Float score = new Float(se.getScore());
          Boolean passed = new Boolean(se.isPassed());
          ScoreEvaluation sceval = new ScoreEvaluation(score, passed, new Long(se.getAssessmentID()));
          AssessableCourseNode acn = (AssessableCourseNode)courseNode; // assessment nodes are assesable     
          boolean incrementUserAttempts = true;
          acn.updateUserScoreEvaluation(sceval, userCourseEnv, urequest.getIdentity(), incrementUserAttempts);
          //userCourseEnv.getScoreAccounting().scoreInfoChanged(acn, sceval);         
          exposeUserTestDataToVC(urequest);
View Full Code Here

Examples of org.olat.course.run.scoring.ScoreEvaluation

    myContent.contextPut("attemptsConfig", modConfig.get(IQEditController.CONFIG_KEY_ATTEMPTS));
    // user data
    if ( !(courseNode instanceof AssessableCourseNode))
      throw new AssertException("exposeUserTestDataToVC can only be called for test nodes, not for selftest or questionnaire");
    AssessableCourseNode acn = (AssessableCourseNode)courseNode; // assessment nodes are assesable
    ScoreEvaluation scoreEval = acn.getUserScoreEvaluation(userCourseEnv);
   
    Identity identity = userCourseEnv.getIdentityEnvironment().getIdentity();
    myContent.contextPut("score", AssessmentHelper.getRoundedScore(scoreEval.getScore()));
    myContent.contextPut("hasPassedValue", (scoreEval.getPassed() == null ? Boolean.FALSE : Boolean.TRUE));
    myContent.contextPut("passed", scoreEval.getPassed());
    myContent.contextPut("comment", acn.getUserUserComment(userCourseEnv));
    myContent.contextPut("attempts", acn.getUserAttempts(userCourseEnv));
   
    UserNodeAuditManager am = userCourseEnv.getCourseEnvironment().getAuditManager();
    myContent.contextPut("log", am.getUserNodeLog(courseNode, identity));
View Full Code Here

Examples of org.olat.course.run.scoring.ScoreEvaluation

    }
     
    if ( !(courseNode instanceof SelfAssessableCourseNode))
      throw new AssertException("exposeUserSelfTestDataToVC can only be called for selftest nodes, not for test or questionnaire");
    SelfAssessableCourseNode acn = (SelfAssessableCourseNode)courseNode;
    ScoreEvaluation scoreEval = acn.getUserScoreEvaluation(userCourseEnv);
    if (scoreEval != null) {
      myContent.contextPut("hasResults", Boolean.TRUE);
      myContent.contextPut("score", AssessmentHelper.getRoundedScore(scoreEval.getScore()));
      myContent.contextPut("hasPassedValue", (scoreEval.getPassed() == null ? Boolean.FALSE : Boolean.TRUE));
      myContent.contextPut("passed", scoreEval.getPassed());
      myContent.contextPut("attempts", new Integer(1)); //at least one attempt
     
      exposeResults(ureq);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.