Examples of UserCourseEnvironment


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

            this.assessedIdentityWrapper = userListModel.getWrappedIdentity(rowid);
          }
          // init edit controller for this identity and this course node
          // or use identity assessment overview if no course node is defined
          if (this.currentCourseNode == null) {
            UserCourseEnvironment chooseUserCourseEnv = assessedIdentityWrapper.getUserCourseEnvironment();   
            removeAsListenerAndDispose(identityAssessmentController);
            identityAssessmentController = new IdentityAssessmentEditController(getWindowControl(),ureq, chooseUserCourseEnv, course, true);
            listenTo(identityAssessmentController);
            setContent(identityAssessmentController.getInitialComponent());
          } else {
View Full Code Here

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

      // Check if the identity in the event is in our local user course environment
      // cache. If so, update the look-uped users score accounting information.
      //Identity identityFromEvent = ace.getIdentity();
      Long identityKeyFromEvent = ace.getIdentityKey();
      if (localUserCourseEnvironmentCache.containsKey(identityKeyFromEvent)) {
        UserCourseEnvironment uce = localUserCourseEnvironmentCache.get(identityKeyFromEvent);         
        // 1) update score accounting
        if (uce != null) {
          uce.getScoreAccounting().evaluateAll();
        }
        // 2) update user table model
        if (userListCtr != null
            && userListCtr.getTableDataModel() instanceof AssessedIdentitiesTableDataModel) {
          // 2.1) search wrapper object in model
View Full Code Here

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

    // check if course node is visible for group
    // get first identity to use this identity for condition interpreter
    Identity identity = getGroupIdentitiesFromGroupmanagement(group).get(0);
    IdentityEnvironment identityEnvironment = new IdentityEnvironment();
    identityEnvironment.setIdentity(identity);
    UserCourseEnvironment uce = new UserCourseEnvironmentImpl(identityEnvironment, course.getCourseEnvironment());
    OnlyGroupConditionInterpreter ci = new OnlyGroupConditionInterpreter(uce);
    List listOfConditionExpressions = courseNode.getConditionExpressions();
    boolean allConditionAreValid = true;
    // loop over all conditions, all must be true
    for (Iterator iter = listOfConditionExpressions.iterator(); iter.hasNext();) {
View Full Code Here

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

  @Override
  protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    setFormTitle("form.title", null);
   
    UserCourseEnvironment userCourseEnv = assessedIdentityWrapper.getUserCourseEnvironment();
    ScoreEvaluation scoreEval = userCourseEnv.getScoreAccounting().evalCourseNode(assessableCourseNode);
    if (scoreEval == null) scoreEval = new ScoreEvaluation(null, null);

    if (hasAttempts) {
      attemptsValue = assessableCourseNode.getUserAttempts(userCourseEnv);
      attempts = uifactory.addIntegerElement("attempts", "form.attempts", (attemptsValue == null ? 0 : attemptsValue.intValue()), formLayout);
View Full Code Here

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

      if (identityAndItsNodePassed[0] != null){
       
        if (allowedIdKeys.contains(((Identity)identityAndItsNodePassed[0]).getKey())){
          IdentityEnvironment ienv = new IdentityEnvironment();
          ienv.setIdentity((Identity)identityAndItsNodePassed[0]);
          UserCourseEnvironment uce = new UserCourseEnvironmentImpl(ienv, course.getCourseEnvironment());
          String nodePassed = (String) identityAndItsNodePassed[1];
          if((nodePassed != null && nodePassed.equals("y")) || (nodePassed != null && nodePassed.equals("n"))){
            if (hasPassed && cut == null){ // Configuration of manual assessment --> Display passed/not passed: yes, Type of display: Manual by tutor
                ScoreEvaluation seOld = courseNode.getUserScoreEvaluation(uce);
                Float score = seOld.getScore();
                Boolean passed = Boolean.TRUE;
                if(nodePassed.equals("n"))passed = Boolean.FALSE;
                ScoreEvaluation seNew = new ScoreEvaluation(score, passed);
               
                // Update score,passed properties in db, and the user's efficiency statement
                boolean incrementAttempts = false;
                courseNode.updateUserScoreEvaluation(seNew, uce, coachIdentity, incrementAttempts);
               
                // Refresh score view
                uce.getScoreAccounting().scoreInfoChanged(this.courseNode, seNew);
               
                Object[] feedback = new Object[]{Boolean.TRUE, identityAndItsNodePassed[0],translator.translate("bulk.action.ok")};
                feedbacks.add(feedback);
            }else{ // Configuration of manual assessment --> Display passed/not passed: no
              Object[] feedback = new Object[]{Boolean.FALSE, identityAndItsNodePassed[0],translator.translate("bulk.action.wrong.config.toSetPassed")};
View Full Code Here

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

    //store ScoreEvaluation for the assessableCourseNode and student
    ScoreEvaluation scoreEvaluation = new ScoreEvaluation(score,passed, assessmentID);
   
    IdentityEnvironment ienv = new IdentityEnvironment();
    ienv.setIdentity(student);
    UserCourseEnvironment userCourseEnv = new UserCourseEnvironmentImpl(ienv, course.getCourseEnvironment());
    boolean incrementAttempts = true;
    //assessableCourseNode.updateUserScoreEvaluation(scoreEvaluation, userCourseEnv, tutor, incrementAttempts); //alternative
     assessmentManager.saveScoreEvaluation(assessableCourseNode, tutor, student, scoreEvaluation, userCourseEnv, incrementAttempts);
     DBFactory.getInstance().closeSession();
     //the attempts mut have been incremented
View Full Code Here

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

    assertNull(efficiencyStatement);
   
    //updateUserEfficiencyStatement of the student identity
    IdentityEnvironment ienv = new IdentityEnvironment();
    ienv.setIdentity(student);
    UserCourseEnvironment userCourseEnv = new UserCourseEnvironmentImpl(ienv, course.getCourseEnvironment());
    efficiencyStatementManager.updateUserEfficiencyStatement(userCourseEnv);
    DBFactory.getInstance().closeSession();
    //check again the stored EfficiencyStatement 
    efficiencyStatement = checkEfficiencyStatement(courseRepositoryEntry);
   
View Full Code Here

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

      assessmentForm = new AssessmentForm(ureq, wControl, courseNode, assessedIdentityWrapper);
      listenTo(assessmentForm);
     
      detailView.put("assessmentform", assessmentForm.getInitialComponent());
      // Add user log. Get it from user properties
      UserCourseEnvironment uce = assessedIdentityWrapper.getUserCourseEnvironment();
      String nodeLog = courseNode.getUserLog(uce);
      detailView.contextPut("log", nodeLog);
      // Add the users details controller
      if (courseNode.hasDetails()) {
        detailView.contextPut("hasDetails", Boolean.TRUE);
View Full Code Here

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

   *
   * @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
      courseNode.updateUserUserComment(newComment, userCourseEnvironment, coachIdentity);
    }

    if (assessmentForm.isCoachCommentDirty()) {
      String newCoachComment = assessmentForm.getCoachComment().getValue();
      // Update properties in db
      this.courseNode.updateUserCoachComment(newCoachComment, userCourseEnvironment);
    }
   
    // Refresh score view
    userCourseEnvironment.getScoreAccounting().scoreInfoChanged(this.courseNode, scoreEval);
  }
View Full Code Here

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

      if (identityAndItsUserComment[0] != null){
       
        if (allowedIdKeys.contains(((Identity)identityAndItsUserComment[0]).getKey())){
          IdentityEnvironment ienv = new IdentityEnvironment();
          ienv.setIdentity((Identity)identityAndItsUserComment[0]);
          UserCourseEnvironment uce = new UserCourseEnvironmentImpl(ienv, course.getCourseEnvironment());
          String userComment = (String) identityAndItsUserComment[1];
          if(userComment != null && !userComment.equals("")){
            if (hasUserComment){
                // Update userComment in db
                courseNode.updateUserUserComment(userComment, uce, coachIdentity);
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.