use of org.olat.course.assessment.bulk.PassedCellRenderer in project OpenOLAT by OpenOLAT.
the class CertificatesSelectionOverviewController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
;
int colPos = 0;
if (isAdministrativeUser) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("table.header.name", CertificatesSelectionDataModel.USERNAME_COL));
}
List<UserPropertyHandler> userPropertyHandlers = userManager.getUserPropertyHandlersFor(AssessedIdentitiesTableDataModel.usageIdentifyer, isAdministrativeUser);
List<UserPropertyHandler> resultingPropertyHandlers = new ArrayList<UserPropertyHandler>();
// followed by the users fields
for (int i = 0; i < userPropertyHandlers.size(); i++) {
UserPropertyHandler userPropertyHandler = userPropertyHandlers.get(i);
boolean visible = userManager.isMandatoryUserProperty(AssessedIdentitiesTableDataModel.usageIdentifyer, userPropertyHandler);
if (visible) {
resultingPropertyHandlers.add(userPropertyHandler);
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(userPropertyHandler.i18nColumnDescriptorLabelKey(), colPos++));
}
}
if (hasAssessableNodes) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("table.header.passed", CertificatesSelectionDataModel.PASSED_COL, new PassedCellRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("table.header.score", CertificatesSelectionDataModel.SCORE_COL));
}
tableModel = new CertificatesSelectionDataModel(columnsModel, resultingPropertyHandlers);
@SuppressWarnings("unchecked") List<CertificateInfos> selectedInfos = (List<CertificateInfos>) getFromRunContext("infos");
tableModel.setObjects(selectedInfos);
uifactory.addTableElement(getWindowControl(), "selection", tableModel, getTranslator(), formLayout);
}
use of org.olat.course.assessment.bulk.PassedCellRenderer in project OpenOLAT by OpenOLAT.
the class GTACoachedGroupGradingController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
assessmentFormButton = uifactory.addFormLink("coach.assessment", "coach.assessment", null, formLayout, Link.BUTTON);
assessmentFormButton.setCustomEnabledLinkCSS("btn btn-primary");
assessmentFormButton.setIconLeftCSS("o_icon o_icon o_icon_submit");
assessmentFormButton.setElementCssClass("o_sel_course_gta_assessment_button");
assessmentFormButton.setVisible(!coachCourseEnv.isCourseReadOnly() && (assignedTask == null || assignedTask.getTaskStatus() != TaskProcess.graded));
reopenButton = uifactory.addFormLink("coach.reopen", "coach.reopen", null, formLayout, Link.BUTTON);
reopenButton.setElementCssClass("o_sel_course_gta_reopen_button");
reopenButton.setVisible(!coachCourseEnv.isCourseReadOnly() && assignedTask != null && assignedTask.getTaskStatus() == TaskProcess.graded);
if (formLayout instanceof FormLayoutContainer) {
ModuleConfiguration config = gtaNode.getModuleConfiguration();
FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
layoutCont.contextPut(MSCourseNode.CONFIG_KEY_HAS_SCORE_FIELD, config.get(MSCourseNode.CONFIG_KEY_HAS_SCORE_FIELD));
layoutCont.contextPut(MSCourseNode.CONFIG_KEY_HAS_PASSED_FIELD, config.get(MSCourseNode.CONFIG_KEY_HAS_PASSED_FIELD));
layoutCont.contextPut(MSCourseNode.CONFIG_KEY_PASSED_CUT_VALUE, AssessmentHelper.getRoundedScore(config.getFloatEntry(MSCourseNode.CONFIG_KEY_PASSED_CUT_VALUE)));
layoutCont.contextPut(MSCourseNode.CONFIG_KEY_SCORE_MIN, AssessmentHelper.getRoundedScore(config.getFloatEntry(MSCourseNode.CONFIG_KEY_SCORE_MIN)));
layoutCont.contextPut(MSCourseNode.CONFIG_KEY_SCORE_MAX, AssessmentHelper.getRoundedScore(config.getFloatEntry(MSCourseNode.CONFIG_KEY_SCORE_MAX)));
if (config.getBooleanSafe(MSCourseNode.CONFIG_KEY_HAS_SCORE_FIELD, false)) {
HighScoreRunController highScoreCtr = new HighScoreRunController(ureq, getWindowControl(), coachCourseEnv, gtaNode);
if (highScoreCtr.isViewHighscore()) {
Component highScoreComponent = highScoreCtr.getInitialComponent();
layoutCont.put("highScore", highScoreComponent);
}
}
}
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
if (isAdministrativeUser) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.username.i18nKey(), Cols.username.ordinal()));
}
int i = 0;
for (UserPropertyHandler userPropertyHandler : userPropertyHandlers) {
int colIndex = GTACoachedGroupGradingController.USER_PROPS_OFFSET + i++;
if (userPropertyHandler == null)
continue;
String propName = userPropertyHandler.getName();
boolean visible = userManager.isMandatoryUserProperty(GTACoachedGroupGradingController.USER_PROPS_ID, userPropertyHandler);
if (visible) {
FlexiColumnModel col;
if (UserConstants.FIRSTNAME.equals(propName) || UserConstants.LASTNAME.equals(propName)) {
col = new DefaultFlexiColumnModel(userPropertyHandler.i18nColumnDescriptorLabelKey(), colIndex, userPropertyHandler.getName(), true, propName, new StaticFlexiCellRenderer(userPropertyHandler.getName(), new TextFlexiCellRenderer()));
} else {
col = new DefaultFlexiColumnModel(true, userPropertyHandler.i18nColumnDescriptorLabelKey(), colIndex, true, propName);
}
columnsModel.addFlexiColumnModel(col);
}
}
if (withPassed) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.passedVal.i18nKey(), Cols.passedVal.ordinal(), new PassedCellRenderer()));
}
if (withScore) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.scoreVal.i18nKey(), Cols.scoreVal.ordinal()));
}
if (withComment) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.commentVal.i18nKey(), Cols.commentVal.ordinal()));
}
model = new GroupAssessmentModel(gtaNode, userPropertyHandlers, getLocale(), columnsModel);
table = uifactory.addTableElement(getWindowControl(), "group-list", model, getTranslator(), formLayout);
table.setCustomizeColumns(true);
table.setAndLoadPersistedPreferences(ureq, "gtagroup-assessment");
}
use of org.olat.course.assessment.bulk.PassedCellRenderer in project OpenOLAT by OpenOLAT.
the class GroupController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
if (formLayout instanceof FormLayoutContainer) {
FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
layoutCont.contextPut("groupName", StringHelper.escapeHtml(group.getName()));
}
// add the table
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
if (isAdministrativeUser) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.name, "select"));
}
int colIndex = UserListController.USER_PROPS_OFFSET;
for (int i = 0; i < userPropertyHandlers.size(); i++) {
UserPropertyHandler userPropertyHandler = userPropertyHandlers.get(i);
boolean visible = userManager.isMandatoryUserProperty(UserListController.usageIdentifyer, userPropertyHandler);
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(visible, userPropertyHandler.i18nColumnDescriptorLabelKey(), colIndex++, "select", true, userPropertyHandler.i18nColumnDescriptorLabelKey()));
}
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.repoName));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.passed, new PassedCellRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.score, new ScoreCellRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.certificate, new DownloadCertificateCellRenderer(getLocale())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.recertification, new DateFlexiCellRenderer(getLocale())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Columns.lastModification));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.lastUserModified));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Columns.lastCoachModified));
model = new EfficiencyStatementEntryTableDataModel(columnsModel);
tableEl = uifactory.addTableElement(getWindowControl(), "table", model, 20, false, getTranslator(), formLayout);
tableEl.setExportEnabled(true);
tableEl.setEmtpyTableMessageKey("error.no.found");
tableEl.setAndLoadPersistedPreferences(ureq, "fGroupController");
}
use of org.olat.course.assessment.bulk.PassedCellRenderer in project OpenOLAT by OpenOLAT.
the class IdentityAssessmentOverviewController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.node, new IndentedNodeRenderer() {
@Override
public boolean isIndentationEnabled() {
return tableEl.getOrderBy() == null || tableEl.getOrderBy().length == 0;
}
}));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.attempts));
if (!followUserResultsVisibility) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.userVisibility, new UserVisibilityCellRenderer(getTranslator())));
}
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.score, new ScoreCellRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.min, new ScoreCellRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.max, new ScoreCellRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.passed, new PassedCellRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.numOfAssessmentDocs));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.status, new AssessmentStatusCellRenderer(getLocale())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, NodeCols.lastModified));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(NodeCols.lastUserModified));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, NodeCols.lastCoachModified));
if (nodesSelectable) {
DefaultFlexiColumnModel selectCol = new DefaultFlexiColumnModel("select", NodeCols.select.ordinal(), CMD_SELECT_NODE, new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("select"), CMD_SELECT_NODE), null));
selectCol.setExportable(false);
columnsModel.addFlexiColumnModel(selectCol);
}
tableModel = new IdentityAssessmentOverviewTableModel(columnsModel);
tableEl = uifactory.addTableElement(getWindowControl(), "table", tableModel, 250, false, getTranslator(), formLayout);
tableEl.setExportEnabled(true);
tableEl.setEmtpyTableMessageKey("nodesoverview.emptylist");
tableEl.setBordered(true);
tableEl.setNumOfRowsEnabled(false);
if (allowTableFiltering) {
List<FlexiTableFilter> filters = new ArrayList<>();
filters.add(new FlexiTableFilter(translate("filter.showAll"), "showAll", true));
filters.add(FlexiTableFilter.SPACER);
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);
}
}
use of org.olat.course.assessment.bulk.PassedCellRenderer in project openolat by klemens.
the class GTACoachedGroupGradingController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
assessmentFormButton = uifactory.addFormLink("coach.assessment", "coach.assessment", null, formLayout, Link.BUTTON);
assessmentFormButton.setCustomEnabledLinkCSS("btn btn-primary");
assessmentFormButton.setIconLeftCSS("o_icon o_icon o_icon_submit");
assessmentFormButton.setElementCssClass("o_sel_course_gta_assessment_button");
assessmentFormButton.setVisible(!coachCourseEnv.isCourseReadOnly() && (assignedTask == null || assignedTask.getTaskStatus() != TaskProcess.graded));
reopenButton = uifactory.addFormLink("coach.reopen", "coach.reopen", null, formLayout, Link.BUTTON);
reopenButton.setElementCssClass("o_sel_course_gta_reopen_button");
reopenButton.setVisible(!coachCourseEnv.isCourseReadOnly() && assignedTask != null && assignedTask.getTaskStatus() == TaskProcess.graded);
if (formLayout instanceof FormLayoutContainer) {
ModuleConfiguration config = gtaNode.getModuleConfiguration();
FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
layoutCont.contextPut(MSCourseNode.CONFIG_KEY_HAS_SCORE_FIELD, config.get(MSCourseNode.CONFIG_KEY_HAS_SCORE_FIELD));
layoutCont.contextPut(MSCourseNode.CONFIG_KEY_HAS_PASSED_FIELD, config.get(MSCourseNode.CONFIG_KEY_HAS_PASSED_FIELD));
layoutCont.contextPut(MSCourseNode.CONFIG_KEY_PASSED_CUT_VALUE, AssessmentHelper.getRoundedScore(config.getFloatEntry(MSCourseNode.CONFIG_KEY_PASSED_CUT_VALUE)));
layoutCont.contextPut(MSCourseNode.CONFIG_KEY_SCORE_MIN, AssessmentHelper.getRoundedScore(config.getFloatEntry(MSCourseNode.CONFIG_KEY_SCORE_MIN)));
layoutCont.contextPut(MSCourseNode.CONFIG_KEY_SCORE_MAX, AssessmentHelper.getRoundedScore(config.getFloatEntry(MSCourseNode.CONFIG_KEY_SCORE_MAX)));
if (config.getBooleanSafe(MSCourseNode.CONFIG_KEY_HAS_SCORE_FIELD, false)) {
HighScoreRunController highScoreCtr = new HighScoreRunController(ureq, getWindowControl(), coachCourseEnv, gtaNode);
if (highScoreCtr.isViewHighscore()) {
Component highScoreComponent = highScoreCtr.getInitialComponent();
layoutCont.put("highScore", highScoreComponent);
}
}
}
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
if (isAdministrativeUser) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.username.i18nKey(), Cols.username.ordinal()));
}
int i = 0;
for (UserPropertyHandler userPropertyHandler : userPropertyHandlers) {
int colIndex = GTACoachedGroupGradingController.USER_PROPS_OFFSET + i++;
if (userPropertyHandler == null)
continue;
String propName = userPropertyHandler.getName();
boolean visible = userManager.isMandatoryUserProperty(GTACoachedGroupGradingController.USER_PROPS_ID, userPropertyHandler);
if (visible) {
FlexiColumnModel col;
if (UserConstants.FIRSTNAME.equals(propName) || UserConstants.LASTNAME.equals(propName)) {
col = new DefaultFlexiColumnModel(userPropertyHandler.i18nColumnDescriptorLabelKey(), colIndex, userPropertyHandler.getName(), true, propName, new StaticFlexiCellRenderer(userPropertyHandler.getName(), new TextFlexiCellRenderer()));
} else {
col = new DefaultFlexiColumnModel(true, userPropertyHandler.i18nColumnDescriptorLabelKey(), colIndex, true, propName);
}
columnsModel.addFlexiColumnModel(col);
}
}
if (withPassed) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.passedVal.i18nKey(), Cols.passedVal.ordinal(), new PassedCellRenderer()));
}
if (withScore) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.scoreVal.i18nKey(), Cols.scoreVal.ordinal()));
}
if (withComment) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.commentVal.i18nKey(), Cols.commentVal.ordinal()));
}
model = new GroupAssessmentModel(gtaNode, userPropertyHandlers, getLocale(), columnsModel);
table = uifactory.addTableElement(getWindowControl(), "group-list", model, getTranslator(), formLayout);
table.setCustomizeColumns(true);
table.setAndLoadPersistedPreferences(ureq, "gtagroup-assessment");
}
Aggregations