Package org.olat.course.condition.interpreter

Examples of org.olat.course.condition.interpreter.OnlyGroupConditionInterpreter


    // 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();) {
      ConditionExpression conditionExpression = (ConditionExpression) iter.next();
      Tracing.logDebug("conditionExpression=" + conditionExpression, this.getClass());
      Tracing.logDebug("conditionExpression.getId()=" + conditionExpression.getId(), this.getClass());
      Condition condition = new Condition();
      condition.setConditionId(conditionExpression.getId());
      condition.setConditionExpression(conditionExpression.getExptressionString());
      if ( !ci.evaluateCondition(condition) ) {
        allConditionAreValid = false;
      }
    }
    return allConditionAreValid;
  }
View Full Code Here

TOP

Related Classes of org.olat.course.condition.interpreter.OnlyGroupConditionInterpreter

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.