Examples of UserCourseEnvironmentImpl


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

    } else {
      IdentityEnvironment ienv = new IdentityEnvironment();
      ienv.setIdentity(identity);
      Roles roles = ManagerFactory.getManager().getRoles(identity);
      ienv.setRoles(roles);
      UserCourseEnvironment userCourseEnv = new UserCourseEnvironmentImpl(ienv, course.getCourseEnvironment());
      // Build an evaluation tree
      TreeEvaluation treeEval = new TreeEvaluation();
      NodeEvaluation nodeEval = node.eval(userCourseEnv.getConditionInterpreter(), treeEval);
      if (nodeEval.isVisible() && validAuthentication(identity, token)) {
        hasAccess = true;
      }
    }
    return hasAccess;
View Full Code Here

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

      if (identityAndItsScore[0] != null){
       
        if (allowedIdKeys.contains(((Identity)identityAndItsScore[0]).getKey())){
          IdentityEnvironment ienv = new IdentityEnvironment();
          ienv.setIdentity((Identity)identityAndItsScore[0]);
          UserCourseEnvironment uce = new UserCourseEnvironmentImpl(ienv, course.getCourseEnvironment());
          String scoreAsString = (String) identityAndItsScore[1];
          if(scoreAsString != null){
            try {
              Float score = Float.valueOf(scoreAsString);
              //*** Score granted: Yes --> it must have a minimum and a maximum score value
              if (hasScore){
                // score < minimum score
                if ((min != null && score.floatValue() < min.floatValue())
                    || (score.floatValue() < AssessmentHelper.MIN_SCORE_SUPPORTED)) {
                  Object[] feedback = new Object[]{Boolean.FALSE, identityAndItsScore[0],
                      translator.translate("bulk.action.lessThanMin",new String[]{String.valueOf(min)})};
                  feedbacks.add(feedback);
                }
                // score > maximum score
                else if ((max != null && score.floatValue() > max.floatValue())
                    || (score.floatValue() > AssessmentHelper.MAX_SCORE_SUPPORTED)) {
                  Object[] feedback = new Object[]{Boolean.FALSE, identityAndItsScore[0],
                      translator.translate("bulk.action.greaterThanMax",new String[]{String.valueOf(max)})};
                  feedbacks.add(feedback);
                }
                // score between minimum and maximum score
                else {
                  ScoreEvaluation se;
                  // *** Display passed/not passed: yes
                  // *** Type of display: automatic using cut value --> it must have a cut value
                  if (hasPassed && cut != null){
                    Boolean passed = (score.floatValue() >= cut.floatValue()) ? Boolean.TRUE  : Boolean.FALSE;
                    se = new ScoreEvaluation(score, passed);
                   
                  // *** Display passed/not passed: yes
                  // *** Type of display: Manual by tutor --> there is no cut value
                  // or
                  // *** Display passed/not passed: no --> there is no cut value
                  }else{
                    se = new ScoreEvaluation(score, null);
                  }
                 
                  // Update score,passed properties in db, and the user's efficiency statement
                  boolean incrementAttempts = false;
                  courseNode.updateUserScoreEvaluation(se, uce, coachIdentity, incrementAttempts);
                 
                  // Refresh score view
                  uce.getScoreAccounting().scoreInfoChanged(this.courseNode, se);
                 
                  Object[] feedback = new Object[]{Boolean.TRUE, identityAndItsScore[0],translator.translate("bulk.action.ok")};
                  feedbacks.add(feedback);
                }
              }else{ // *** Score granted: No
View Full Code Here

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

    super(ureq, wControl);
    // set up the components
    luTree = new MenuTree("luTreeRun", this);

    // build up the running structure for this user;
    uce = new UserCourseEnvironmentImpl(identEnv, cenv);
    navHandler = new NavigationHandler(uce, true);
   
    // evaluate scoring
    uce.getScoreAccounting().evaluateAll();
   
View Full Code Here

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

   */
  static UserCourseEnvironment createAndInitUserCourseEnvironment(Identity identity, ICourse course) {
    // create an identenv with no roles, no attributes, no locale
    IdentityEnvironment ienv = new IdentityEnvironment();
    ienv.setIdentity(identity);
    UserCourseEnvironment uce = new UserCourseEnvironmentImpl(ienv, course.getCourseEnvironment());
    // Fetch all score and passed and calculate score accounting for the entire
    // course
    uce.getScoreAccounting().evaluateAll();
    return uce;
  }
View Full Code Here

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

      Identity identity = (Identity) iter.next();
      if (identity != null){ 
        IdentityEnvironment ienv = new IdentityEnvironment();
        ienv.setIdentity(identity);
        ICourse course = CourseFactory.loadCourse(ores);
        UserCourseEnvironment uce = new UserCourseEnvironmentImpl(ienv, course.getCourseEnvironment());
        ScoreEvaluation scoreEvaluation = uce.getScoreAccounting().getScoreEvaluation(courseNode);
       
        if(scoreEvaluation == null){
          nodePassedResults.add(translator.translate("bulk.action.no.value"));
        }else{
          Boolean nodePassed = scoreEvaluation.getPassed();
View Full Code Here

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

      }

      // create a identenv with no roles, no attributes, no locale
      IdentityEnvironment ienv = new IdentityEnvironment();
      ienv.setIdentity(identity);
      UserCourseEnvironment uce = new UserCourseEnvironmentImpl(ienv, course.getCourseEnvironment());
      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();
View Full Code Here

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

      Identity identity = (Identity) iter.next();
      if (identity != null){
        IdentityEnvironment ienv = new IdentityEnvironment();
        ienv.setIdentity(identity);
        ICourse course = CourseFactory.loadCourse(ores);
        UserCourseEnvironment uce = new UserCourseEnvironmentImpl(ienv, course.getCourseEnvironment());
        ScoreEvaluation scoreEvaluation = uce.getScoreAccounting().getScoreEvaluation(courseNode);
       
        if (scoreEvaluation == null){
            nodeScores.add(translator.translate("bulk.action.no.value"));
        }else{
          Float nodeScore = scoreEvaluation.getScore();
View Full Code Here

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

   
    ICourse course = CourseFactory.loadCourse(repositoryEntry.getOlatResource());
    IdentityEnvironment ienv = new IdentityEnvironment();
    ienv.setIdentity(identity);
    ienv.setRoles(roles);
    UserCourseEnvironment userCourseEnv = new UserCourseEnvironmentImpl(ienv, course.getCourseEnvironment());
    if (log.isDebug()) log.debug("userCourseEnv=" + userCourseEnv + "ienv=" + ienv );
   
    CourseNode rootCn = userCourseEnv.getCourseEnvironment().getRunStructure().getRootNode();

    String nodeIdS = nodeId.toString();
    CourseNode courseNode = course.getRunStructure().getNode(nodeIdS);
    if (log.isDebug()) log.debug("courseNode=" + courseNode );
   
    TreeEvaluation treeEval = new TreeEvaluation();
    NodeEvaluation rootNodeEval = rootCn.eval(userCourseEnv.getConditionInterpreter(), treeEval);
    if (log.isDebug()) log.debug("rootNodeEval=" + rootNodeEval );

    TreeNode newCalledTreeNode = treeEval.getCorrespondingTreeNode(courseNode);
    if (newCalledTreeNode == null) {
      // TreeNode no longer visible
View Full Code Here

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

    // 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.UserCourseEnvironmentImpl

      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
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.