use of org.olat.modules.lecture.model.LectureBlockImpl in project openolat by klemens.
the class LectureServiceImpl method autoCloseRollCall.
@Override
public void autoCloseRollCall() {
int period = lectureModule.getRollCallAutoClosePeriod();
if (period > 0) {
Date now = new Date();
Calendar cal = Calendar.getInstance();
cal.setTime(now);
cal.add(Calendar.DATE, -period);
Date endDate = cal.getTime();
List<LectureBlockImpl> blocks = lectureBlockDao.loadOpenBlocksBefore(endDate);
for (LectureBlockImpl block : blocks) {
autoClose(block);
dbInstance.commitAndCloseSession();
}
}
}
use of org.olat.modules.lecture.model.LectureBlockImpl in project openolat by klemens.
the class LectureBlockDAO method addGroupToLectureBlock.
public LectureBlock addGroupToLectureBlock(LectureBlock block, Group group) {
LectureBlockImpl reloadedBlock = (LectureBlockImpl) loadByKey(block.getKey());
LectureBlockToGroupImpl blockToGroup = new LectureBlockToGroupImpl();
blockToGroup.setGroup(group);
blockToGroup.setLectureBlock(block);
dbInstance.getCurrentEntityManager().persist(blockToGroup);
return reloadedBlock;
}
Aggregations