use of org.olat.course.assessment.ui.tool.AssessedIdentityListProvider in project OpenOLAT by OpenOLAT.
the class AssessedIdentityListController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
if (formLayout instanceof FormLayoutContainer) {
FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
layoutCont.contextPut("title", testEntry.getDisplayname());
RepositoryHandler handler = repositoryHandlerFactory.getRepositoryHandler(testEntry);
layoutCont.contextPut("cssClass", RepositoyUIFactory.getIconCssClass(handler.getSupportedType()));
}
// add the table
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
if (isAdministrativeUser) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdentityCourseElementCols.username, "select"));
}
int colIndex = AssessmentToolConstants.USER_PROPS_OFFSET;
for (int i = 0; i < userPropertyHandlers.size(); i++) {
UserPropertyHandler userPropertyHandler = userPropertyHandlers.get(i);
boolean visible = UserManager.getInstance().isMandatoryUserProperty(AssessmentToolConstants.usageIdentifyer, userPropertyHandler);
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(visible, userPropertyHandler.i18nColumnDescriptorLabelKey(), colIndex, "select", true, "userProp-" + colIndex));
colIndex++;
}
if (element.hasAttemptsConfigured()) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdentityCourseElementCols.attempts, "select"));
}
if (element.hasScoreConfigured()) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdentityCourseElementCols.min, "select", new ScoreCellRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdentityCourseElementCols.max, "select", new ScoreCellRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdentityCourseElementCols.score, "select", new ScoreCellRenderer()));
}
if (element.hasPassedConfigured()) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdentityCourseElementCols.passed, new PassedCellRenderer()));
}
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdentityCourseElementCols.assessmentStatus, new AssessmentStatusCellRenderer(getLocale())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdentityCourseElementCols.initialLaunchDate, "select"));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, IdentityCourseElementCols.lastModified, "select"));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdentityCourseElementCols.lastUserModified, "select"));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, IdentityCourseElementCols.lastCoachModified, "select"));
usersTableModel = new AssessedIdentityListTableModel(columnsModel, element);
usersTableModel.setCertificateMap(new ConcurrentHashMap<>());
tableEl = uifactory.addTableElement(getWindowControl(), "table", usersTableModel, 20, false, getTranslator(), formLayout);
tableEl.setExportEnabled(true);
tableEl.setSearchEnabled(new AssessedIdentityListProvider(getIdentity(), testEntry, testEntry, null, assessmentCallback), ureq.getUserSession());
List<FlexiTableFilter> filters = new ArrayList<>();
filters.add(new FlexiTableFilter(translate("filter.passed"), "passed"));
filters.add(new FlexiTableFilter(translate("filter.failed"), "failed"));
filters.add(new FlexiTableFilter(translate("filter.inProgress"), "inProgress"));
filters.add(new FlexiTableFilter(translate("filter.inReview"), "inReview"));
filters.add(new FlexiTableFilter(translate("filter.done"), "done"));
tableEl.setFilters("", filters, false);
if (assessmentCallback.canAssessBusinessGoupMembers()) {
List<BusinessGroup> coachedGroups;
if (assessmentCallback.isAdmin()) {
SearchBusinessGroupParams params = new SearchBusinessGroupParams();
coachedGroups = businessGroupService.findBusinessGroups(params, testEntry, 0, -1);
} else {
coachedGroups = assessmentCallback.getCoachedGroups();
}
if (coachedGroups.size() > 0) {
List<FlexiTableFilter> groupFilters = new ArrayList<>();
for (BusinessGroup coachedGroup : coachedGroups) {
String groupName = StringHelper.escapeHtml(coachedGroup.getName());
groupFilters.add(new FlexiTableFilter(groupName, coachedGroup.getKey().toString(), "o_icon o_icon_group"));
}
tableEl.setExtendedFilterButton(translate("filter.groups"), groupFilters);
}
}
}
use of org.olat.course.assessment.ui.tool.AssessedIdentityListProvider in project openolat by klemens.
the class AssessedIdentityListController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
if (formLayout instanceof FormLayoutContainer) {
FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
layoutCont.contextPut("title", testEntry.getDisplayname());
RepositoryHandler handler = repositoryHandlerFactory.getRepositoryHandler(testEntry);
layoutCont.contextPut("cssClass", RepositoyUIFactory.getIconCssClass(handler.getSupportedType()));
}
// add the table
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
if (isAdministrativeUser) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdentityCourseElementCols.username, "select"));
}
int colIndex = AssessmentToolConstants.USER_PROPS_OFFSET;
for (int i = 0; i < userPropertyHandlers.size(); i++) {
UserPropertyHandler userPropertyHandler = userPropertyHandlers.get(i);
boolean visible = UserManager.getInstance().isMandatoryUserProperty(AssessmentToolConstants.usageIdentifyer, userPropertyHandler);
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(visible, userPropertyHandler.i18nColumnDescriptorLabelKey(), colIndex, "select", true, "userProp-" + colIndex));
colIndex++;
}
if (element.hasAttemptsConfigured()) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdentityCourseElementCols.attempts, "select"));
}
if (element.hasScoreConfigured()) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdentityCourseElementCols.min, "select", new ScoreCellRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdentityCourseElementCols.max, "select", new ScoreCellRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdentityCourseElementCols.score, "select", new ScoreCellRenderer()));
}
if (element.hasPassedConfigured()) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdentityCourseElementCols.passed, new PassedCellRenderer()));
}
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdentityCourseElementCols.assessmentStatus, new AssessmentStatusCellRenderer(getLocale())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdentityCourseElementCols.initialLaunchDate, "select"));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, IdentityCourseElementCols.lastModified, "select"));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdentityCourseElementCols.lastUserModified, "select"));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, IdentityCourseElementCols.lastCoachModified, "select"));
usersTableModel = new AssessedIdentityListTableModel(columnsModel, element);
usersTableModel.setCertificateMap(new ConcurrentHashMap<>());
tableEl = uifactory.addTableElement(getWindowControl(), "table", usersTableModel, 20, false, getTranslator(), formLayout);
tableEl.setExportEnabled(true);
tableEl.setSearchEnabled(new AssessedIdentityListProvider(getIdentity(), testEntry, testEntry, null, assessmentCallback), ureq.getUserSession());
List<FlexiTableFilter> filters = new ArrayList<>();
filters.add(new FlexiTableFilter(translate("filter.passed"), "passed"));
filters.add(new FlexiTableFilter(translate("filter.failed"), "failed"));
filters.add(new FlexiTableFilter(translate("filter.inProgress"), "inProgress"));
filters.add(new FlexiTableFilter(translate("filter.inReview"), "inReview"));
filters.add(new FlexiTableFilter(translate("filter.done"), "done"));
tableEl.setFilters("", filters, false);
if (assessmentCallback.canAssessBusinessGoupMembers()) {
List<BusinessGroup> coachedGroups;
if (assessmentCallback.isAdmin()) {
SearchBusinessGroupParams params = new SearchBusinessGroupParams();
coachedGroups = businessGroupService.findBusinessGroups(params, testEntry, 0, -1);
} else {
coachedGroups = assessmentCallback.getCoachedGroups();
}
if (coachedGroups.size() > 0) {
List<FlexiTableFilter> groupFilters = new ArrayList<>();
for (BusinessGroup coachedGroup : coachedGroups) {
String groupName = StringHelper.escapeHtml(coachedGroup.getName());
groupFilters.add(new FlexiTableFilter(groupName, coachedGroup.getKey().toString(), "o_icon o_icon_group"));
}
tableEl.setExtendedFilterButton(translate("filter.groups"), groupFilters);
}
}
}
Aggregations