Search in sources :

Example 1 with LectureBlockIdentityStatistics

use of org.olat.modules.lecture.model.LectureBlockIdentityStatistics in project OpenOLAT by OpenOLAT.

the class LecturesSearchController method doSearch.

private void doSearch(UserRequest ureq) {
    LectureStatisticsSearchParameters params = searchForm.getSearchParameters();
    List<UserPropertyHandler> userPropertyHandlers = searchForm.getUserPropertyHandlers();
    List<LectureBlockIdentityStatistics> statistics = lectureService.getLecturesStatistics(params, userPropertyHandlers, getIdentity(), admin);
    Set<Long> identities = statistics.stream().map(LectureBlockIdentityStatistics::getIdentityKey).collect(Collectors.toSet());
    Controller ctrl;
    if (identities.size() <= 1) {
        listCtrl = new LecturesListController(ureq, getWindowControl(), statistics, userPropertyHandlers, LecturesSearchFormController.PROPS_IDENTIFIER, true, true);
        listenTo(listCtrl);
        ctrl = listCtrl;
    } else {
        multipleUsersCtrl = new LecturesListSegmentController(ureq, getWindowControl(), statistics, userPropertyHandlers, LecturesSearchFormController.PROPS_IDENTIFIER);
        listenTo(multipleUsersCtrl);
        ctrl = multipleUsersCtrl;
    }
    stackPanel.popUpToRootController(ureq);
    stackPanel.pushController(translate("results"), ctrl);
}
Also used : LectureStatisticsSearchParameters(org.olat.modules.lecture.model.LectureStatisticsSearchParameters) LectureBlockIdentityStatistics(org.olat.modules.lecture.model.LectureBlockIdentityStatistics) Controller(org.olat.core.gui.control.Controller) BasicController(org.olat.core.gui.control.controller.BasicController) LectureRepositoryAdminController(org.olat.modules.lecture.ui.LectureRepositoryAdminController) UserPropertyHandler(org.olat.user.propertyhandlers.UserPropertyHandler)

Example 2 with LectureBlockIdentityStatistics

use of org.olat.modules.lecture.model.LectureBlockIdentityStatistics in project OpenOLAT by OpenOLAT.

the class LecturesStatisticsExport method addContentAggregated.

private void addContentAggregated(OpenXMLWorksheet exportSheet, OpenXMLWorkbook workbook) {
    List<LectureBlockIdentityStatistics> aggregatedStatistics = lectureService.groupByIdentity(statistics);
    for (LectureBlockIdentityStatistics statistic : aggregatedStatistics) {
        Row row = exportSheet.newRow();
        int pos = 0;
        pos = addContentUser(statistic, row, pos);
        addContentStatistics(statistic, row, pos, workbook);
    }
}
Also used : LectureBlockIdentityStatistics(org.olat.modules.lecture.model.LectureBlockIdentityStatistics) Row(org.olat.core.util.openxml.OpenXMLWorksheet.Row)

Example 3 with LectureBlockIdentityStatistics

use of org.olat.modules.lecture.model.LectureBlockIdentityStatistics in project OpenOLAT by OpenOLAT.

the class LecturesStatisticsExport method addContentDetailled.

private void addContentDetailled(OpenXMLWorksheet exportSheet, OpenXMLWorkbook workbook) {
    for (LectureBlockIdentityStatistics statistic : statistics) {
        Row row = exportSheet.newRow();
        int pos = 0;
        pos = addContentUser(statistic, row, pos);
        row.addCell(pos++, statistic.getExternalRef());
        row.addCell(pos++, statistic.getDisplayName());
        addContentStatistics(statistic, row, pos, workbook);
    }
}
Also used : LectureBlockIdentityStatistics(org.olat.modules.lecture.model.LectureBlockIdentityStatistics) Row(org.olat.core.util.openxml.OpenXMLWorksheet.Row)

Example 4 with LectureBlockIdentityStatistics

use of org.olat.modules.lecture.model.LectureBlockIdentityStatistics in project OpenOLAT by OpenOLAT.

the class LecturesListController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (source == tableEl) {
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            String cmd = se.getCommand();
            if ("open.course".equals(cmd)) {
                LectureBlockIdentityStatistics row = tableModel.getObject(se.getIndex());
                doOpenCourseLectures(ureq, row);
            }
        }
    } else if (source == exportButton) {
        doExportStatistics(ureq);
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent) LectureBlockIdentityStatistics(org.olat.modules.lecture.model.LectureBlockIdentityStatistics)

Example 5 with LectureBlockIdentityStatistics

use of org.olat.modules.lecture.model.LectureBlockIdentityStatistics in project openolat by klemens.

the class LecturesSearchController method doSearch.

private void doSearch(UserRequest ureq) {
    LectureStatisticsSearchParameters params = searchForm.getSearchParameters();
    List<UserPropertyHandler> userPropertyHandlers = searchForm.getUserPropertyHandlers();
    List<LectureBlockIdentityStatistics> statistics = lectureService.getLecturesStatistics(params, userPropertyHandlers, getIdentity(), admin);
    Set<Long> identities = statistics.stream().map(LectureBlockIdentityStatistics::getIdentityKey).collect(Collectors.toSet());
    Controller ctrl;
    if (identities.size() <= 1) {
        listCtrl = new LecturesListController(ureq, getWindowControl(), statistics, userPropertyHandlers, LecturesSearchFormController.PROPS_IDENTIFIER, true, true);
        listenTo(listCtrl);
        ctrl = listCtrl;
    } else {
        multipleUsersCtrl = new LecturesListSegmentController(ureq, getWindowControl(), statistics, userPropertyHandlers, LecturesSearchFormController.PROPS_IDENTIFIER);
        listenTo(multipleUsersCtrl);
        ctrl = multipleUsersCtrl;
    }
    stackPanel.popUpToRootController(ureq);
    stackPanel.pushController(translate("results"), ctrl);
}
Also used : LectureStatisticsSearchParameters(org.olat.modules.lecture.model.LectureStatisticsSearchParameters) LectureBlockIdentityStatistics(org.olat.modules.lecture.model.LectureBlockIdentityStatistics) Controller(org.olat.core.gui.control.Controller) BasicController(org.olat.core.gui.control.controller.BasicController) LectureRepositoryAdminController(org.olat.modules.lecture.ui.LectureRepositoryAdminController) UserPropertyHandler(org.olat.user.propertyhandlers.UserPropertyHandler)

Aggregations

LectureBlockIdentityStatistics (org.olat.modules.lecture.model.LectureBlockIdentityStatistics)12 ArrayList (java.util.ArrayList)4 HashMap (java.util.HashMap)4 Row (org.olat.core.util.openxml.OpenXMLWorksheet.Row)4 UserPropertyHandler (org.olat.user.propertyhandlers.UserPropertyHandler)4 Date (java.util.Date)2 Map (java.util.Map)2 SelectionEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent)2 Controller (org.olat.core.gui.control.Controller)2 BasicController (org.olat.core.gui.control.controller.BasicController)2 LectureStatisticsSearchParameters (org.olat.modules.lecture.model.LectureStatisticsSearchParameters)2 LectureRepositoryAdminController (org.olat.modules.lecture.ui.LectureRepositoryAdminController)2