.getPackageName(MSCourseNodeEditController.class), ureq.getLocale()));
setTranslator(newTranslator);
accessabilityVC = this.createVelocityContainer("edit");
// Task precondition
taskConditionC = new ConditionEditController(ureq, getWindowControl(), groupMgr, node.getConditionTask(), "taskConditionForm",
AssessmentHelper.getAssessableNodes(course.getEditorTreeModel(), node), euce);
this.listenTo(taskConditionC);
if (((Boolean) config.get(TACourseNode.CONF_TASK_ENABLED)).booleanValue()) accessabilityVC.put("taskCondition", taskConditionC
.getInitialComponent());
// DropBox precondition
dropConditionC = new ConditionEditController(ureq, getWindowControl(), groupMgr, node.getConditionDrop(), "dropConditionForm",
AssessmentHelper.getAssessableNodes(course.getEditorTreeModel(), node), euce);
this.listenTo(dropConditionC);
Boolean hasDropboxValue = ((Boolean) config.get(TACourseNode.CONF_DROPBOX_ENABLED)!=null) ? (Boolean) config.get(TACourseNode.CONF_DROPBOX_ENABLED) : false;
if (hasDropboxValue) accessabilityVC.put("dropCondition", dropConditionC.getInitialComponent());
//returnbox precondition - use dropbox condition if none defined for returnbox
Condition dropboxCondition = node.getConditionDrop();
Condition returnboxCondition = node.getConditionReturnbox();
if(dropboxCondition!=null && returnboxCondition!= null && returnboxCondition.getConditionExpression()==null) {
//old courses: use ConditionExpression from dropbox if none defined for returnbox
returnboxCondition = dropboxCondition;
returnboxCondition.setConditionId(TACourseNode.ACCESS_RETURNBOX);
node.setConditionReturnbox(returnboxCondition);
}
returnboxConditionC = new ConditionEditController(ureq, getWindowControl(), groupMgr, returnboxCondition, "returnboxConditionForm",
AssessmentHelper.getAssessableNodes(course.getEditorTreeModel(), node), euce);
this.listenTo(returnboxConditionC);
Object returnBoxConf = config.get(TACourseNode.CONF_RETURNBOX_ENABLED);
//use the dropbox config if none specified for the return box
boolean returnBoxEnabled = (returnBoxConf !=null) ? ((Boolean) returnBoxConf).booleanValue() : hasDropboxValue;
if (returnBoxEnabled) accessabilityVC.put("returnboxCondition", returnboxConditionC.getInitialComponent());
// Scoring precondition
scoringConditionC = new ConditionEditController(ureq, getWindowControl(), groupMgr, node.getConditionScoring(), "scoringConditionForm",
AssessmentHelper.getAssessableNodes(course.getEditorTreeModel(), node), euce);
this.listenTo(scoringConditionC);
if (((Boolean) config.get(TACourseNode.CONF_SCORING_ENABLED)).booleanValue()) accessabilityVC.put("scoringCondition", scoringConditionC
.getInitialComponent());
// SolutionFolder precondition
solutionConditionC = new ConditionEditController(ureq, getWindowControl(), groupMgr, node.getConditionSolution(),
"solutionConditionForm", AssessmentHelper.getAssessableNodes(course.getEditorTreeModel(), node), euce);
this.listenTo(solutionConditionC);
if (((Boolean) config.get(TACourseNode.CONF_SOLUTION_ENABLED)).booleanValue()) accessabilityVC.put("solutionCondition", solutionConditionC
.getInitialComponent());