use of org.olat.modules.lecture.LectureBlockRollCall in project OpenOLAT by OpenOLAT.
the class AbstractLectureBlockAuditLogExport method addContent.
private void addContent(OpenXMLWorksheet exportSheet, OpenXMLWorkbook workbook) {
for (LectureBlockAuditLog 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());
// repo entry title
row.addCell(pos++, getRepositoryEntryDisplayName(logEntry.getEntryKey()), null);
// lecture block
row.addCell(pos++, getLectureBlockTitle(logEntry.getLectureBlockKey()), null);
// date start / end
// planned / effective
LectureBlock auditBlock = null;
LectureBlockRollCall auditRollCall = null;
LectureParticipantSummary auditSummary = null;
if (logEntry.getRollCallKey() != null) {
auditRollCall = getAuditRollCall(logEntry.getAfter());
}
if (auditRollCall == null) {
if (logEntry.getLectureBlockKey() != null) {
auditBlock = getAuditLectureBlock(logEntry.getAfter());
} else {
auditSummary = getAuditLectureParticipantSummary(logEntry.getAfter());
}
}
if (auditBlock != null) {
if (auditBlock.getStatus() == null) {
pos++;
} else {
row.addCell(pos++, auditBlock.getStatus().name(), null);
}
row.addCell(pos++, auditBlock.getPlannedLecturesNumber(), null);
row.addCell(pos++, auditBlock.getEffectiveLecturesNumber(), null);
row.addCell(pos++, auditBlock.getEffectiveEndDate(), workbook.getStyles().getDateTimeStyle());
} else {
pos += 4;
}
if (auditRollCall != null) {
Long assessedIdentityKey = logEntry.getIdentityKey();
String fullname = userManager.getUserDisplayName(assessedIdentityKey);
row.addCell(pos++, fullname);
row.addCell(pos++, auditRollCall.getLecturesAttendedNumber(), null);
row.addCell(pos++, auditRollCall.getLecturesAbsentNumber(), null);
if (authorizedAbsenceEnabled) {
if (auditRollCall.getAbsenceAuthorized() != null && auditRollCall.getAbsenceAuthorized().booleanValue()) {
row.addCell(pos++, "x");
} else {
pos++;
}
row.addCell(pos++, auditRollCall.getAbsenceReason(), null);
}
row.addCell(pos++, auditRollCall.getComment(), null);
} else if (auditSummary != null) {
Long assessedIdentityKey = logEntry.getIdentityKey();
String fullname = userManager.getUserDisplayName(assessedIdentityKey);
row.addCell(pos++, fullname);
pos += 2;
if (authorizedAbsenceEnabled) {
pos += 2;
}
String summaryComment = getSummaryComment(getAuditLectureParticipantSummary(logEntry.getBefore()), auditSummary);
row.addCell(pos++, summaryComment, null);
} else {
pos += 4;
if (authorizedAbsenceEnabled) {
pos += 2;
}
}
Long authorKey = logEntry.getAuthorKey();
if (authorKey != null) {
String fullname = userManager.getUserDisplayName(authorKey);
row.addCell(pos++, fullname);
}
}
}
use of org.olat.modules.lecture.LectureBlockRollCall in project OpenOLAT by OpenOLAT.
the class LectureBlockExport method addContent.
private void addContent(OpenXMLWorksheet exportSheet) {
List<Identity> participants = lectureService.getParticipants(lectureBlock);
List<LectureBlockRollCall> rollCalls = lectureService.getRollCalls(lectureBlock);
Map<Identity, LectureBlockRollCall> participantToRollCallMap = rollCalls.stream().collect(Collectors.toMap(r -> r.getIdentity(), r -> r));
for (Identity participant : participants) {
Row row = exportSheet.newRow();
int pos = 0;
if (isAdministrativeUser) {
row.addCell(pos++, participant.getName());
}
for (UserPropertyHandler userPropertyHandler : userPropertyHandlers) {
if (userPropertyHandler == null)
continue;
String val = userPropertyHandler.getUserProperty(participant.getUser(), translator.getLocale());
row.addCell(pos++, val);
}
LectureBlockRollCall rollCall = participantToRollCallMap.get(participant);
if (rollCall != null) {
List<Integer> absentList = rollCall.getLecturesAbsentList();
for (int i = 0; i < lectureBlock.getPlannedLecturesNumber(); i++) {
String val = absentList.contains(i) ? "x" : null;
row.addCell(pos++, val);
}
if (authorizedAbsenceEnabled && rollCall.getAbsenceAuthorized() != null && rollCall.getAbsenceAuthorized().booleanValue()) {
row.addCell(pos++, "x");
row.addCell(pos++, rollCall.getAbsenceReason());
}
}
}
}
use of org.olat.modules.lecture.LectureBlockRollCall in project OpenOLAT by OpenOLAT.
the class ParticipantLectureBlocksController method doAppealAudit.
private void doAppealAudit(LectureBlockAndRollCall row, String message) {
logAudit("Appeal send for lecture block: " + row.getLectureBlockTitle() + " (" + row.getLectureBlockRef().getKey() + ")", null);
LectureBlock lectureBlock = lectureService.getLectureBlock(row.getLectureBlockRef());
LectureBlockRollCall rollCall = lectureService.getRollCall(row.getRollCallRef());
lectureService.auditLog(Action.sendAppeal, null, null, message, lectureBlock, rollCall, entry, assessedIdentity, null);
dbInstance.commit();
loadModel();
tableEl.reset(false, false, true);
}
use of org.olat.modules.lecture.LectureBlockRollCall in project openolat by klemens.
the class TeacherLecturesTableController method doExportAttendanceList.
private void doExportAttendanceList(UserRequest ureq, LectureBlock row) {
LectureBlock lectureBlock = lectureService.getLectureBlock(row);
List<Identity> participants = lectureService.getParticipants(lectureBlock);
List<LectureBlockRollCall> rollCalls = lectureService.getRollCalls(row);
try {
LecturesBlockPDFExport export = new LecturesBlockPDFExport(lectureBlock, authorizedAbsenceEnabled, getTranslator());
export.setTeacher(userManager.getUserDisplayName(getIdentity()));
export.create(participants, rollCalls);
ureq.getDispatchResult().setResultingMediaResource(export);
} catch (IOException | TransformerException e) {
logError("", e);
}
}
use of org.olat.modules.lecture.LectureBlockRollCall in project openolat by klemens.
the class TeacherRollCallController method loadModel.
private void loadModel() {
List<LectureBlockRollCall> rollCalls = lectureService.getRollCalls(lectureBlock);
Map<Identity, LectureBlockRollCall> rollCallMap = new HashMap<>();
for (LectureBlockRollCall rollCall : rollCalls) {
rollCallMap.put(rollCall.getIdentity(), rollCall);
}
List<TeacherRollCallRow> rows = new ArrayList<>(participants.size());
for (Identity participant : participants) {
LectureBlockRollCall rollCall = rollCallMap.get(participant);
rows.add(forgeRow(participant, rollCall));
}
tableModel.setObjects(rows);
tableEl.reset(false, false, true);
}
Aggregations