use of org.olat.modules.assessment.ui.ScoreCellRenderer in project OpenOLAT by OpenOLAT.
the class CorrectionIdentityAssessmentItemListController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
stackPanel.addListener(this);
if (formLayout instanceof FormLayoutContainer) {
FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
layoutCont.contextPut("title", title);
}
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdentityItemCols.section));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdentityItemCols.itemTitle, "select"));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, IdentityItemCols.itemKeywords, "select"));
Translator qti21Translator = Util.createPackageTranslator(AssessmentTestComposerController.class, getLocale());
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdentityItemCols.itemType, new QuestionTypeFlexiCellRenderer(qti21Translator)));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdentityItemCols.score, new ScoreCellRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdentityItemCols.answered, "answered"));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdentityItemCols.autoCorrected, "corrected", new AutoCorrectedFlexiCellRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdentityItemCols.corrected, "corrected", new CorrectedFlexiCellRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdentityItemCols.notCorrected, "notCorrected", new NotCorrectedFlexiCellRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdentityItemCols.toReview, "toReview", new ToReviewFlexiCellRenderer()));
tableModel = new CorrectionIdentityAssessmentItemTableModel(columnsModel, getLocale());
tableEl = uifactory.addTableElement(getWindowControl(), "table", tableModel, getTranslator(), formLayout);
tableEl.setExportEnabled(true);
tableEl.setAndLoadPersistedPreferences(ureq, "corr-identity-assessment-item-list");
if (saveEnabled) {
uifactory.addFormCancelButton("cancel", formLayout, ureq, getWindowControl());
saveButton = uifactory.addFormLink("save", formLayout, Link.BUTTON);
}
}
use of org.olat.modules.assessment.ui.ScoreCellRenderer 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.modules.assessment.ui.ScoreCellRenderer 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.modules.assessment.ui.ScoreCellRenderer in project OpenOLAT by OpenOLAT.
the class AssessedBusinessGroupCourseNodeListController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, ABGCols.key, "select"));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ABGCols.name, "select"));
if (courseNode instanceof AssessableCourseNode) {
AssessableCourseNode aNode = (AssessableCourseNode) courseNode;
if (aNode.hasPassedConfigured()) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ABGCols.countPassed, new ProgressRenderer(false, getTranslator())));
}
if (aNode.hasScoreConfigured()) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ABGCols.averageScore, new ScoreCellRenderer()));
}
}
tableModel = new AssessedBusinessGroupTableModel(columnsModel, getLocale());
tableEl = uifactory.addTableElement(getWindowControl(), "table", tableModel, 20, false, getTranslator(), formLayout);
tableEl.setExportEnabled(true);
FlexiTableSortOptions options = new FlexiTableSortOptions();
options.setDefaultOrderBy(new SortKey(ABGCols.name.name(), true));
tableEl.setSortSettings(options);
tableEl.setAndLoadPersistedPreferences(ureq, "assessment-tool-group-list");
if (formLayout instanceof FormLayoutContainer) {
FormLayoutContainer layoutcont = (FormLayoutContainer) formLayout;
if (courseNode != null) {
String courseNodeCssClass = CourseNodeFactory.getInstance().getCourseNodeConfigurationEvenForDisabledBB(courseNode.getType()).getIconCSSClass();
layoutcont.contextPut("courseNodeCssClass", courseNodeCssClass);
layoutcont.contextPut("courseNodeTitle", courseNode.getShortTitle());
}
}
}
use of org.olat.modules.assessment.ui.ScoreCellRenderer in project openolat by klemens.
the class BinderAssessmentController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(AssessmentSectionCols.sectionName));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(AssessmentSectionCols.numOfPages));
if (withPassed) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(AssessmentSectionCols.passed, new PassedCellRenderer()));
}
if (withScore) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(AssessmentSectionCols.score, new ScoreCellRenderer()));
}
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(AssessmentSectionCols.changeStatus, new SectionStatusCellRenderer(getTranslator())));
model = new BinderAssessmentDataModel(columnsModel);
tableEl = uifactory.addTableElement(getWindowControl(), "section-list", model, getTranslator(), formLayout);
tableEl.setCustomizeColumns(true);
tableEl.setEditMode(true);
tableEl.setAndLoadPersistedPreferences(ureq, "section-assessment");
FormLayoutContainer buttonsCont = FormLayoutContainer.createButtonLayout("buttons", getTranslator());
formLayout.add(buttonsCont);
saveButton = uifactory.addFormSubmitButton("save", buttonsCont);
saveButton.setElementCssClass("o_sel_pf_assessment_save");
saveAndDoneLink = uifactory.addFormLink("save.done", buttonsCont, Link.BUTTON);
saveAndDoneLink.setElementCssClass("o_sel_pf_assessment_save_done");
reopenLink = uifactory.addFormLink("reopen.binder", buttonsCont, Link.BUTTON);
reopenLink.setElementCssClass("o_sel_pf_assessment_reopen");
cancelButton = uifactory.addFormCancelButton("cancel", buttonsCont, ureq, getWindowControl());
}
Aggregations