Search in sources :

Example 1 with LectureBlockStatus

use of org.olat.modules.lecture.LectureBlockStatus in project OpenOLAT by OpenOLAT.

the class LectureServiceImpl method adaptRollCalls.

@Override
public void adaptRollCalls(LectureBlock lectureBlock) {
    LectureBlockStatus status = lectureBlock.getStatus();
    LectureRollCallStatus rollCallStatus = lectureBlock.getRollCallStatus();
    if (status == LectureBlockStatus.done || rollCallStatus == LectureRollCallStatus.closed || rollCallStatus == LectureRollCallStatus.autoclosed) {
        log.warn("Try to adapt roll call of a closed lecture block: " + lectureBlock.getKey());
        return;
    }
    List<LectureBlockRollCall> rollCallList = lectureBlockRollCallDao.getRollCalls(lectureBlock);
    for (LectureBlockRollCall rollCall : rollCallList) {
        int numOfLectures = lectureBlock.getEffectiveLecturesNumber();
        if (numOfLectures <= 0 && lectureBlock.getStatus() != LectureBlockStatus.cancelled) {
            numOfLectures = lectureBlock.getPlannedLecturesNumber();
        }
        lectureBlockRollCallDao.adaptLecture(lectureBlock, rollCall, numOfLectures, null);
    }
}
Also used : LectureRollCallStatus(org.olat.modules.lecture.LectureRollCallStatus) LectureBlockStatus(org.olat.modules.lecture.LectureBlockStatus) LectureBlockRollCall(org.olat.modules.lecture.LectureBlockRollCall)

Example 2 with LectureBlockStatus

use of org.olat.modules.lecture.LectureBlockStatus in project OpenOLAT by OpenOLAT.

the class LectureBlockStatusCellRenderer method render.

@Override
public void render(Renderer renderer, StringOutput target, Object cellValue, int row, FlexiTableComponent source, URLBuilder ubu, Translator trans) {
    if (cellValue instanceof LectureBlockStatus) {
        LectureBlockStatus status = (LectureBlockStatus) cellValue;
        target.append(translator.translate(status.name()));
    } else if (cellValue instanceof LectureBlock) {
        LectureBlock block = (LectureBlock) cellValue;
        String status = getStatus(block, translator);
        if (StringHelper.containsNonWhitespace(status)) {
            target.append(status);
        }
    }
}
Also used : LectureBlock(org.olat.modules.lecture.LectureBlock) LectureBlockStatus(org.olat.modules.lecture.LectureBlockStatus)

Example 3 with LectureBlockStatus

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

the class LectureServiceImpl method adaptRollCalls.

@Override
public void adaptRollCalls(LectureBlock lectureBlock) {
    LectureBlockStatus status = lectureBlock.getStatus();
    LectureRollCallStatus rollCallStatus = lectureBlock.getRollCallStatus();
    if (status == LectureBlockStatus.done || rollCallStatus == LectureRollCallStatus.closed || rollCallStatus == LectureRollCallStatus.autoclosed) {
        log.warn("Try to adapt roll call of a closed lecture block: " + lectureBlock.getKey());
        return;
    }
    List<LectureBlockRollCall> rollCallList = lectureBlockRollCallDao.getRollCalls(lectureBlock);
    for (LectureBlockRollCall rollCall : rollCallList) {
        int numOfLectures = lectureBlock.getEffectiveLecturesNumber();
        if (numOfLectures <= 0 && lectureBlock.getStatus() != LectureBlockStatus.cancelled) {
            numOfLectures = lectureBlock.getPlannedLecturesNumber();
        }
        lectureBlockRollCallDao.adaptLecture(lectureBlock, rollCall, numOfLectures, null);
    }
}
Also used : LectureRollCallStatus(org.olat.modules.lecture.LectureRollCallStatus) LectureBlockStatus(org.olat.modules.lecture.LectureBlockStatus) LectureBlockRollCall(org.olat.modules.lecture.LectureBlockRollCall)

Example 4 with LectureBlockStatus

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

the class ParticipantLectureBlocksDataModel method isDataVisible.

private boolean isDataVisible(LectureBlockAndRollCall row) {
    LectureBlockStatus status = row.getStatus();
    if (LectureBlockStatus.cancelled.equals(status)) {
        return false;
    }
    LectureRollCallStatus rollCallStatus = row.getRollCallStatus();
    return status == LectureBlockStatus.done && (rollCallStatus == LectureRollCallStatus.closed || rollCallStatus == LectureRollCallStatus.autoclosed);
}
Also used : LectureRollCallStatus(org.olat.modules.lecture.LectureRollCallStatus) LectureBlockStatus(org.olat.modules.lecture.LectureBlockStatus)

Example 5 with LectureBlockStatus

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

the class LectureBlockRollCallStatusCellRenderer method render.

private void render(StringOutput target, LectureBlockAndRollCall rollCall) {
    if (rollCall.isRollCalled()) {
        LectureBlockStatus status = rollCall.getStatus();
        LectureRollCallStatus rollCallStatus = rollCall.getRollCallStatus();
        if (status == LectureBlockStatus.cancelled) {
            String title = translator.translate("cancelled");
            target.append("<span title='").append(title).append("'><i class='o_icon o_icon-lg o_icon_cancelled'> </i></span>");
        } else if (status == LectureBlockStatus.done && (rollCallStatus == LectureRollCallStatus.closed || rollCallStatus == LectureRollCallStatus.autoclosed)) {
            renderClosed(target, rollCall);
        } else {
            String title = translator.translate("in.progress");
            target.append("<span title='").append(title).append("'><i class='o_icon o_icon-lg o_icon_status_in_review'> </i></span>");
        }
    } else if (!rollCall.isCompulsory()) {
        String title = translator.translate("rollcall.tooltip.free");
        target.append("<span title='").append(title).append("'><i class='o_icon o_icon-lg o_lectures_rollcall_free'> </i></span>");
    }
}
Also used : LectureRollCallStatus(org.olat.modules.lecture.LectureRollCallStatus) LectureBlockStatus(org.olat.modules.lecture.LectureBlockStatus)

Aggregations

LectureBlockStatus (org.olat.modules.lecture.LectureBlockStatus)8 LectureRollCallStatus (org.olat.modules.lecture.LectureRollCallStatus)6 LectureBlock (org.olat.modules.lecture.LectureBlock)2 LectureBlockRollCall (org.olat.modules.lecture.LectureBlockRollCall)2