fireEvent(ureq, Event.DONE_EVENT);
}
}
else if (source == groupListCtr) {
if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
TableEvent te = (TableEvent) event;
String actionid = te.getActionId();
if (actionid.equals(CMD_CHOOSE_GROUP)) {
int rowid = te.getRowId();
GroupAndContextTableModel groupListModel = (GroupAndContextTableModel) groupListCtr.getTableDataModel();
this.currentGroup = groupListModel.getBusinessGroupAt(rowid);
this.identitiesList = getGroupIdentitiesFromGroupmanagement(this.currentGroup);
// Init the user list with this identitites list
doUserChooseWithData(ureq, this.identitiesList, this.currentGroup, this.currentCourseNode);
}
}
}
else if (source == userListCtr) {
if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
TableEvent te = (TableEvent) event;
String actionid = te.getActionId();
if (actionid.equals(CMD_CHOOSE_USER)) {
int rowid = te.getRowId();
ICourse course = CourseFactory.loadCourse(ores);
if (userListCtr.getTableDataModel() instanceof UserTableDataModel) {
// in user MODE_USERFOCUS, a simple identity table is used, no wrapped identites
UserTableDataModel userListModel = (UserTableDataModel) userListCtr.getTableDataModel();
Identity assessedIdentity = userListModel.getIdentityAt(rowid);
this.assessedIdentityWrapper = AssessmentHelper.wrapIdentity(assessedIdentity,
this.localUserCourseEnvironmentCache, course, null);
} else {
// all other cases where user can be choosen the assessed identity wrapper is used
AssessedIdentitiesTableDataModel userListModel = (AssessedIdentitiesTableDataModel) userListCtr.getTableDataModel();
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 {
removeAsListenerAndDispose(assessmentEditController);
assessmentEditController = new AssessmentEditController(ureq, getWindowControl(),course, currentCourseNode, assessedIdentityWrapper);
listenTo(assessmentEditController);
main.setContent(assessmentEditController.getInitialComponent());
}
}
} else if (event.equals(TableController.EVENT_FILTER_SELECTED)) {
this.currentCourseNode = (AssessableCourseNode) userListCtr.getActiveFilter();
doUserChooseWithData(ureq, this.identitiesList, this.currentGroup, this.currentCourseNode);
}
}
else if (source == nodeListCtr) {
if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
TableEvent te = (TableEvent) event;
String actionid = te.getActionId();
if (actionid.equals(CMD_SELECT_NODE)) {
ICourse course = CourseFactory.loadCourse(ores);
int rowid = te.getRowId();
Map<String,Object> nodeData = (Map<String,Object>) nodeTableModel.getObject(rowid);
CourseNode node = course.getRunStructure().getNode((String) nodeData.get(AssessmentHelper.KEY_IDENTIFYER));
this.currentCourseNode = (AssessableCourseNode) node;
// cast should be save, only assessable nodes are selectable
doGroupChoose(ureq);