Search in sources :

Example 6 with PassedCellRenderer

use of org.olat.course.assessment.bulk.PassedCellRenderer in project OpenOLAT by OpenOLAT.

the class CourseController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    openCourse = uifactory.addFormLink("open.course", formLayout, Link.BUTTON);
    openCourse.setIconLeftCSS("o_icon o_CourseModule_icon");
    if (formLayout instanceof FormLayoutContainer) {
        FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
        layoutCont.contextPut("courseName", StringHelper.escapeHtml(course.getDisplayname()));
    }
    // 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()));
    CourseConfig courseConfig = CourseFactory.loadCourse(course).getCourseConfig();
    if (courseConfig.isCertificateEnabled()) {
        columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.certificate, new DownloadCertificateCellRenderer(getLocale())));
        if (courseConfig.isRecertificationEnabled()) {
            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, "fCourseController");
}
Also used : DateFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.DateFlexiCellRenderer) ScoreCellRenderer(org.olat.modules.assessment.ui.ScoreCellRenderer) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) PassedCellRenderer(org.olat.course.assessment.bulk.PassedCellRenderer) DownloadCertificateCellRenderer(org.olat.course.certificate.ui.DownloadCertificateCellRenderer) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel) UserPropertyHandler(org.olat.user.propertyhandlers.UserPropertyHandler) CourseConfig(org.olat.course.config.CourseConfig)

Example 7 with PassedCellRenderer

use of org.olat.course.assessment.bulk.PassedCellRenderer in project openolat by klemens.

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");
}
Also used : DateFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.DateFlexiCellRenderer) ScoreCellRenderer(org.olat.modules.assessment.ui.ScoreCellRenderer) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) PassedCellRenderer(org.olat.course.assessment.bulk.PassedCellRenderer) DownloadCertificateCellRenderer(org.olat.course.certificate.ui.DownloadCertificateCellRenderer) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel) UserPropertyHandler(org.olat.user.propertyhandlers.UserPropertyHandler)

Example 8 with PassedCellRenderer

use of org.olat.course.assessment.bulk.PassedCellRenderer in project openolat by klemens.

the class CourseController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    openCourse = uifactory.addFormLink("open.course", formLayout, Link.BUTTON);
    openCourse.setIconLeftCSS("o_icon o_CourseModule_icon");
    if (formLayout instanceof FormLayoutContainer) {
        FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
        layoutCont.contextPut("courseName", StringHelper.escapeHtml(course.getDisplayname()));
    }
    // 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()));
    CourseConfig courseConfig = CourseFactory.loadCourse(course).getCourseConfig();
    if (courseConfig.isCertificateEnabled()) {
        columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.certificate, new DownloadCertificateCellRenderer(getLocale())));
        if (courseConfig.isRecertificationEnabled()) {
            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, "fCourseController");
}
Also used : DateFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.DateFlexiCellRenderer) ScoreCellRenderer(org.olat.modules.assessment.ui.ScoreCellRenderer) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) PassedCellRenderer(org.olat.course.assessment.bulk.PassedCellRenderer) DownloadCertificateCellRenderer(org.olat.course.certificate.ui.DownloadCertificateCellRenderer) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel) UserPropertyHandler(org.olat.user.propertyhandlers.UserPropertyHandler) CourseConfig(org.olat.course.config.CourseConfig)

Example 9 with PassedCellRenderer

use of org.olat.course.assessment.bulk.PassedCellRenderer in project openolat by klemens.

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);
    }
}
Also used : ArrayList(java.util.ArrayList) IndentedNodeRenderer(org.olat.course.assessment.IndentedNodeRenderer) StaticFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer) ScoreCellRenderer(org.olat.modules.assessment.ui.ScoreCellRenderer) BooleanCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer) FlexiTableFilter(org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) PassedCellRenderer(org.olat.course.assessment.bulk.PassedCellRenderer) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Example 10 with PassedCellRenderer

use of org.olat.course.assessment.bulk.PassedCellRenderer 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);
        }
    }
}
Also used : BusinessGroup(org.olat.group.BusinessGroup) AssessedIdentityListProvider(org.olat.course.assessment.ui.tool.AssessedIdentityListProvider) ArrayList(java.util.ArrayList) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer) SearchBusinessGroupParams(org.olat.group.model.SearchBusinessGroupParams) AssessmentStatusCellRenderer(org.olat.course.assessment.ui.tool.AssessmentStatusCellRenderer) FlexiTableFilter(org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) RepositoryHandler(org.olat.repository.handlers.RepositoryHandler) PassedCellRenderer(org.olat.course.assessment.bulk.PassedCellRenderer) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel) UserPropertyHandler(org.olat.user.propertyhandlers.UserPropertyHandler)

Aggregations

DefaultFlexiColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)20 FlexiTableColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel)20 PassedCellRenderer (org.olat.course.assessment.bulk.PassedCellRenderer)20 UserPropertyHandler (org.olat.user.propertyhandlers.UserPropertyHandler)16 FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)10 ScoreCellRenderer (org.olat.modules.assessment.ui.ScoreCellRenderer)10 ArrayList (java.util.ArrayList)8 DateFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.DateFlexiCellRenderer)8 StaticFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer)8 DownloadCertificateCellRenderer (org.olat.course.certificate.ui.DownloadCertificateCellRenderer)6 FlexiTableFilter (org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter)4 BooleanCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer)4 FlexiColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiColumnModel)4 TextFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.TextFlexiCellRenderer)4 CertificateInfos (org.olat.course.certificate.model.CertificateInfos)4 HashSet (java.util.HashSet)2 List (java.util.List)2 Component (org.olat.core.gui.components.Component)2 Identity (org.olat.core.id.Identity)2 ICourse (org.olat.course.ICourse)2