Search in sources :

Example 1 with LectureRollCallStatus

use of org.olat.modules.lecture.LectureRollCallStatus 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 LectureRollCallStatus

use of org.olat.modules.lecture.LectureRollCallStatus 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 3 with LectureRollCallStatus

use of org.olat.modules.lecture.LectureRollCallStatus 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 4 with LectureRollCallStatus

use of org.olat.modules.lecture.LectureRollCallStatus 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)

Example 5 with LectureRollCallStatus

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

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)6 LectureRollCallStatus (org.olat.modules.lecture.LectureRollCallStatus)6 LectureBlockRollCall (org.olat.modules.lecture.LectureBlockRollCall)2