Search in sources :

Example 6 with Row

use of org.olat.core.util.openxml.OpenXMLWorksheet.Row in project OpenOLAT by OpenOLAT.

the class LectureBlockExport method addHeaders_3.

private void addHeaders_3(OpenXMLWorksheet exportSheet) {
    Row headerRow = exportSheet.newRow();
    int pos = 0;
    if (isAdministrativeUser) {
        headerRow.addCell(pos++, translator.translate("table.header.username"));
    }
    for (UserPropertyHandler userPropertyHandler : userPropertyHandlers) {
        if (userPropertyHandler == null)
            continue;
        String propName = userPropertyHandler.getName();
        headerRow.addCell(pos++, translator.translate("form.name." + propName));
    }
    for (int i = 0; i < lectureBlock.getPlannedLecturesNumber(); i++) {
        headerRow.addCell(pos++, Integer.toString(i + 1));
    }
    if (authorizedAbsenceEnabled) {
        // authorized absence
        headerRow.addCell(pos++, translator.translate("table.header.authorized.absence"));
        // authorized absence reason
        headerRow.addCell(pos++, translator.translate("authorized.absence.reason"));
    }
    // comment
    headerRow.addCell(pos++, translator.translate("table.header.comment"));
}
Also used : Row(org.olat.core.util.openxml.OpenXMLWorksheet.Row) UserPropertyHandler(org.olat.user.propertyhandlers.UserPropertyHandler)

Example 7 with Row

use of org.olat.core.util.openxml.OpenXMLWorksheet.Row in project OpenOLAT by OpenOLAT.

the class LectureBlockExport method addFooter.

private void addFooter(OpenXMLWorksheet exportSheet) {
    exportSheet.newRow();
    exportSheet.newRow();
    Row footerRow = exportSheet.newRow();
    int pos = 0;
    if (isAdministrativeUser) {
        pos++;
    }
    for (UserPropertyHandler userPropertyHandler : userPropertyHandlers) {
        if (userPropertyHandler == null)
            continue;
        pos++;
    }
    footerRow.addCell(pos, translator.translate("export.footer.lectures.hint"));
}
Also used : Row(org.olat.core.util.openxml.OpenXMLWorksheet.Row) UserPropertyHandler(org.olat.user.propertyhandlers.UserPropertyHandler)

Example 8 with Row

use of org.olat.core.util.openxml.OpenXMLWorksheet.Row in project OpenOLAT by OpenOLAT.

the class QuestionItemAuditLogExport method addContent.

@SuppressWarnings("deprecation")
private void addContent(OpenXMLWorksheet exportSheet, OpenXMLWorkbook workbook) {
    for (QuestionItemAuditLog logEntry : auditLog) {
        int pos = 0;
        Row row = exportSheet.newRow();
        Date creationDate = logEntry.getCreationDate();
        row.addCell(pos++, creationDate, workbook.getStyles().getDateTimeStyle());
        row.addCell(pos++, logEntry.getAction());
        QuestionItem item = null;
        if (logEntry.getQuestionItemKey() != null) {
            item = qpoolService.toAuditQuestionItem(logEntry.getAfter());
        }
        if (item != null) {
            row.addCell(pos++, item.getTitle());
            row.addCell(pos++, item.getTopic());
            if (qpoolModule.isTaxonomyEnabled()) {
                row.addCell(pos++, item.getTaxonomicPath());
            }
            if (qpoolModule.isEducationalContextEnabled()) {
                row.addCell(pos++, getTranslatedContext(item.getEducationalContext()));
            }
            row.addCell(pos++, item.getKeywords());
            row.addCell(pos++, item.getAdditionalInformations());
            row.addCell(pos++, item.getCoverage());
            row.addCell(pos++, item.getLanguage());
            row.addCell(pos++, getTranslatedAssessmentType(item.getAssessmentType()));
            row.addCell(pos++, getTranslatedItemType(item.getItemType()));
            row.addCell(pos++, item.getEducationalLearningTime());
            row.addCell(pos++, format(item.getDifficulty()));
            row.addCell(pos++, format(item.getStdevDifficulty()));
            row.addCell(pos++, format(item.getDifferentiation()));
            row.addCell(pos++, String.valueOf(item.getNumOfAnswerAlternatives()));
            row.addCell(pos++, String.valueOf(item.getUsage()));
            row.addCell(pos++, item.getItemVersion());
            row.addCell(pos++, getTranslatedStatus(item.getQuestionStatus()));
        } else {
            pos += 16;
            if (qpoolModule.isTaxonomyEnabled()) {
                pos++;
            }
            if (qpoolModule.isEducationalContextEnabled()) {
                pos++;
            }
        }
        if (licenseModule.isEnabled(licenseHandler)) {
            License license = licenseService.licenseFromXml(logEntry.getLicenseAfter());
            if (license != null) {
                row.addCell(pos++, license.getLicenseType() != null ? license.getLicenseType().getName() : null);
                row.addCell(pos++, license.getLicensor());
            } else if (item != null) {
                // Backward compatibility:
                // Before the introduction of the LicenseService the license was stored in the item itself.
                row.addCell(pos++, item.getLicense() != null ? item.getLicense().getLicenseKey() : null);
                row.addCell(pos++, item.getCreator());
            } else {
                pos += 2;
            }
        }
        Long authorKey = logEntry.getAuthorKey();
        if (authorKey != null) {
            String fullname = userManager.getUserDisplayName(authorKey);
            row.addCell(pos++, fullname);
        }
    }
}
Also used : License(org.olat.core.commons.services.license.License) Row(org.olat.core.util.openxml.OpenXMLWorksheet.Row) QuestionItem(org.olat.modules.qpool.QuestionItem) QuestionItemAuditLog(org.olat.modules.qpool.QuestionItemAuditLog) Date(java.util.Date)

Example 9 with Row

use of org.olat.core.util.openxml.OpenXMLWorksheet.Row in project OpenOLAT by OpenOLAT.

the class QuestionItemAuditLogExport method addHeader.

private void addHeader(OpenXMLWorksheet exportSheet) {
    exportSheet.setHeaderRows(2);
    Row headerRow = exportSheet.newRow();
    int pos = 0;
    headerRow.addCell(pos++, translator.translate("export.log.header.log.date"));
    headerRow.addCell(pos++, translator.translate("export.log.header.log.action"));
    headerRow.addCell(pos++, translator.translate("export.log.header.title"));
    headerRow.addCell(pos++, translator.translate("export.log.header.topic"));
    if (qpoolModule.isTaxonomyEnabled()) {
        headerRow.addCell(pos++, translator.translate("export.log.header.taxonomic.path"));
    }
    if (qpoolModule.isEducationalContextEnabled()) {
        headerRow.addCell(pos++, translator.translate("export.log.header.context"));
    }
    headerRow.addCell(pos++, translator.translate("export.log.header.keywords"));
    headerRow.addCell(pos++, translator.translate("export.log.header.additional.informations"));
    headerRow.addCell(pos++, translator.translate("export.log.header.coverage"));
    headerRow.addCell(pos++, translator.translate("export.log.header.language"));
    headerRow.addCell(pos++, translator.translate("export.log.header.assessment.type"));
    headerRow.addCell(pos++, translator.translate("export.log.header.item.type"));
    headerRow.addCell(pos++, translator.translate("export.log.header.learningTime"));
    headerRow.addCell(pos++, translator.translate("export.log.header.difficulty"));
    headerRow.addCell(pos++, translator.translate("export.log.header.stdevDifficulty"));
    headerRow.addCell(pos++, translator.translate("export.log.header.differentiation"));
    headerRow.addCell(pos++, translator.translate("export.log.header.numOfAnswerAlternatives"));
    headerRow.addCell(pos++, translator.translate("export.log.header.usage"));
    headerRow.addCell(pos++, translator.translate("export.log.header.version"));
    headerRow.addCell(pos++, translator.translate("export.log.header.status"));
    if (licenseModule.isEnabled(licenseHandler)) {
        headerRow.addCell(pos++, translator.translate("export.log.header.license"));
        headerRow.addCell(pos++, translator.translate("export.log.header.licensor"));
    }
    headerRow.addCell(pos++, translator.translate("export.log.header.log.author"));
}
Also used : Row(org.olat.core.util.openxml.OpenXMLWorksheet.Row)

Example 10 with Row

use of org.olat.core.util.openxml.OpenXMLWorksheet.Row in project OpenOLAT by OpenOLAT.

the class LecturesBlocksEntryExport method addContent.

private void addContent(OpenXMLWorksheet exportSheet) {
    for (LectureBlockWithTeachers block : blocks) {
        Row row = exportSheet.newRow();
        LectureBlock lectureBlock = block.getLectureBlock();
        int pos = 0;
        row.addCell(pos++, lectureBlock.getTitle());
        row.addCell(pos++, lectureBlock.getLocation());
        row.addCell(pos++, formatDate(lectureBlock.getStartDate()));
        row.addCell(pos++, formatTime(lectureBlock.getStartDate()));
        row.addCell(pos++, formatTime(lectureBlock.getEndDate()));
        StringBuilder teachers = new StringBuilder();
        for (Identity teacher : block.getTeachers()) {
            if (teachers.length() > 0)
                teachers.append(", ");
            teachers.append(userManager.getUserDisplayName(teacher));
        }
        row.addCell(pos++, teachers.toString());
        if (lectureBlock.getRollCallStatus() == null) {
            pos++;
        } else {
            String status = LectureBlockStatusCellRenderer.getStatus(lectureBlock, translator);
            if (status != null) {
                row.addCell(pos++, status);
            } else {
                pos++;
            }
        }
        row.addCell(pos++, formatter.formatDate(lectureBlock.getAutoClosedDate()));
        row.addCell(pos++, toInt(lectureBlock.getPlannedLecturesNumber()));
        row.addCell(pos++, toInt(lectureBlock.getEffectiveLecturesNumber()));
        row.addCell(pos++, formatTime(lectureBlock.getEffectiveEndDate()));
        Reason reason = lectureBlock.getReasonEffectiveEnd();
        if (reason == null) {
            pos++;
        } else {
            row.addCell(pos++, reason.getTitle());
        }
        row.addCell(pos++, lectureBlock.getComment());
    }
}
Also used : LectureBlockWithTeachers(org.olat.modules.lecture.model.LectureBlockWithTeachers) LectureBlock(org.olat.modules.lecture.LectureBlock) Row(org.olat.core.util.openxml.OpenXMLWorksheet.Row) Identity(org.olat.core.id.Identity) Reason(org.olat.modules.lecture.Reason)

Aggregations

Row (org.olat.core.util.openxml.OpenXMLWorksheet.Row)66 UserPropertyHandler (org.olat.user.propertyhandlers.UserPropertyHandler)24 Date (java.util.Date)12 Identity (org.olat.core.id.Identity)12 IOException (java.io.IOException)10 Translator (org.olat.core.gui.translator.Translator)10 OpenXMLWorkbook (org.olat.core.util.openxml.OpenXMLWorkbook)10 OpenXMLWorksheet (org.olat.core.util.openxml.OpenXMLWorksheet)10 OutputStream (java.io.OutputStream)8 CellStyle (org.olat.core.util.openxml.workbookstyle.CellStyle)8 AssessableCourseNode (org.olat.course.nodes.AssessableCourseNode)8 User (org.olat.core.id.User)6 Formatter (org.olat.core.util.Formatter)6 OpenXMLWorkbookResource (org.olat.core.util.openxml.OpenXMLWorkbookResource)6 AssociateInteraction (uk.ac.ed.ph.jqtiplus.node.item.interaction.AssociateInteraction)6 ChoiceInteraction (uk.ac.ed.ph.jqtiplus.node.item.interaction.ChoiceInteraction)6 CustomInteraction (uk.ac.ed.ph.jqtiplus.node.item.interaction.CustomInteraction)6 DrawingInteraction (uk.ac.ed.ph.jqtiplus.node.item.interaction.DrawingInteraction)6 EndAttemptInteraction (uk.ac.ed.ph.jqtiplus.node.item.interaction.EndAttemptInteraction)6 ExtendedTextInteraction (uk.ac.ed.ph.jqtiplus.node.item.interaction.ExtendedTextInteraction)6