use of org.olat.course.condition.interpreter.ConditionExpression in project openolat by klemens.
the class InfoCourseNode method getConditionExpressions.
@Override
public List<ConditionExpression> getConditionExpressions() {
List<ConditionExpression> parentConditions = super.getConditionExpressions();
List<ConditionExpression> conditions = new ArrayList<>();
if (parentConditions != null && parentConditions.size() > 0) {
conditions.addAll(parentConditions);
}
Condition editCondition = getPreConditionEdit();
if (editCondition != null && StringHelper.containsNonWhitespace(editCondition.getConditionExpression())) {
ConditionExpression ce = new ConditionExpression(editCondition.getConditionId());
ce.setExpressionString(editCondition.getConditionExpression());
conditions.add(ce);
}
Condition adminCondition = getPreConditionAdmin();
if (adminCondition != null && StringHelper.containsNonWhitespace(adminCondition.getConditionExpression())) {
ConditionExpression ce = new ConditionExpression(adminCondition.getConditionId());
ce.setExpressionString(adminCondition.getConditionExpression());
conditions.add(ce);
}
return conditions;
}
use of org.olat.course.condition.interpreter.ConditionExpression in project openolat by klemens.
the class ProjectBrokerCourseNode method getConditionExpressions.
/**
* @see org.olat.course.nodes.GenericCourseNode#getConditionExpressions()
*/
@Override
public List<ConditionExpression> getConditionExpressions() {
List<ConditionExpression> retVal;
List<ConditionExpression> parentsConditions = super.getConditionExpressions();
if (parentsConditions.size() > 0) {
retVal = new ArrayList<>(parentsConditions);
} else {
retVal = new ArrayList<>();
}
String condition = getConditionProjectBroker().getConditionExpression();
if (condition != null && !condition.equals("")) {
// an active condition is defined
ConditionExpression ce = new ConditionExpression(getConditionProjectBroker().getConditionId());
ce.setExpressionString(getConditionProjectBroker().getConditionExpression());
retVal.add(ce);
}
return retVal;
}
use of org.olat.course.condition.interpreter.ConditionExpression in project openolat by klemens.
the class STCourseNode method getConditionExpressions.
/**
* @see org.olat.course.nodes.AbstractAccessableCourseNode#getConditionExpressions()
*/
@Override
public List<ConditionExpression> getConditionExpressions() {
List<ConditionExpression> retVal;
List<ConditionExpression> parentsConditions = super.getConditionExpressions();
if (parentsConditions.size() > 0) {
retVal = new ArrayList<ConditionExpression>(parentsConditions);
} else {
retVal = new ArrayList<ConditionExpression>();
}
// init passedExpression and scoreExpression
getScoreCalculator();
passedExpression.setExpertMode(true);
String coS = passedExpression.getConditionExpression();
if (StringHelper.containsNonWhitespace(coS)) {
// an active condition is defined
ConditionExpression ce = new ConditionExpression(passedExpression.getConditionId());
ce.setExpressionString(passedExpression.getConditionExpression());
retVal.add(ce);
}
scoreExpression.setExpertMode(true);
coS = scoreExpression.getConditionExpression();
if (StringHelper.containsNonWhitespace(coS)) {
// an active condition is defined
ConditionExpression ce = new ConditionExpression(scoreExpression.getConditionId());
ce.setExpressionString(scoreExpression.getConditionExpression());
retVal.add(ce);
}
failedExpression.setExpertMode(true);
coS = failedExpression.getConditionExpression();
if (StringHelper.containsNonWhitespace(coS)) {
// an active condition is defined
ConditionExpression ce = new ConditionExpression(failedExpression.getConditionId());
ce.setExpressionString(failedExpression.getConditionExpression());
retVal.add(ce);
}
return retVal;
}
use of org.olat.course.condition.interpreter.ConditionExpression in project openolat by klemens.
the class ForumNodeForumCallback method getConditionExpressions.
/**
* @see org.olat.course.nodes.GenericCourseNode#getConditionExpressions()
*/
public List<ConditionExpression> getConditionExpressions() {
List<ConditionExpression> retVal;
List<ConditionExpression> parentsConditions = super.getConditionExpressions();
if (parentsConditions.size() > 0) {
retVal = new ArrayList<ConditionExpression>(parentsConditions);
} else {
retVal = new ArrayList<ConditionExpression>();
}
//
String coS = getPreConditionModerator().getConditionExpression();
if (coS != null && !coS.equals("")) {
// an active condition is defined
ConditionExpression ce = new ConditionExpression(getPreConditionModerator().getConditionId());
ce.setExpressionString(getPreConditionModerator().getConditionExpression());
retVal.add(ce);
}
coS = getPreConditionPoster().getConditionExpression();
if (coS != null && !coS.equals("")) {
// an active condition is defined
ConditionExpression ce = new ConditionExpression(getPreConditionPoster().getConditionId());
ce.setExpressionString(getPreConditionPoster().getConditionExpression());
retVal.add(ce);
}
coS = getPreConditionReader().getConditionExpression();
if (coS != null && !coS.equals("")) {
// an active condition is defined
ConditionExpression ce = new ConditionExpression(getPreConditionReader().getConditionId());
ce.setExpressionString(getPreConditionReader().getConditionExpression());
retVal.add(ce);
}
//
return retVal;
}
use of org.olat.course.condition.interpreter.ConditionExpression in project openolat by klemens.
the class TACourseNode method getConditionExpressions.
/**
* @see org.olat.course.nodes.GenericCourseNode#getConditionExpressions()
*/
@Override
public List<ConditionExpression> getConditionExpressions() {
List<ConditionExpression> retVal;
List<ConditionExpression> parentsConditions = super.getConditionExpressions();
if (parentsConditions.size() > 0) {
retVal = new ArrayList<ConditionExpression>(parentsConditions);
} else {
retVal = new ArrayList<ConditionExpression>();
}
//
String coS = getConditionDrop().getConditionExpression();
if (coS != null && !coS.equals("")) {
// an active condition is defined
ConditionExpression ce = new ConditionExpression(getConditionDrop().getConditionId());
ce.setExpressionString(getConditionDrop().getConditionExpression());
retVal.add(ce);
}
coS = getConditionReturnbox().getConditionExpression();
if (coS != null && !coS.equals("")) {
// an active condition is defined
ConditionExpression ce = new ConditionExpression(getConditionReturnbox().getConditionId());
ce.setExpressionString(getConditionReturnbox().getConditionExpression());
retVal.add(ce);
} else if (coS == null && getConditionDrop().getConditionExpression() != null && !getConditionDrop().getConditionExpression().equals("")) {
// old courses that had dropbox but no returnbox: use for returnbox the conditionExpression from dropbox
ConditionExpression ce = new ConditionExpression(getConditionReturnbox().getConditionId());
ce.setExpressionString(getConditionDrop().getConditionExpression());
retVal.add(ce);
}
coS = getConditionScoring().getConditionExpression();
if (coS != null && !coS.equals("")) {
// an active condition is defined
ConditionExpression ce = new ConditionExpression(getConditionScoring().getConditionId());
ce.setExpressionString(getConditionScoring().getConditionExpression());
retVal.add(ce);
}
coS = getConditionTask().getConditionExpression();
if (coS != null && !coS.equals("")) {
// an active condition is defined
ConditionExpression ce = new ConditionExpression(getConditionTask().getConditionId());
ce.setExpressionString(getConditionTask().getConditionExpression());
retVal.add(ce);
}
//
return retVal;
}
Aggregations