diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamDAOImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamDAOImpl.java index b10ee3cb..bebe7c29 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamDAOImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamDAOImpl.java @@ -153,6 +153,10 @@ public class ExamDAOImpl implements ExamDAO { } if (from != null) { + // always show exams that has not ended yet + if (exam.endTime == null || exam.endTime.isAfter(from)) { + return true; + } if (exam.startTime.isBefore(from)) { return false; } @@ -755,7 +759,7 @@ public class ExamDAOImpl implements ExamDAO { try { status = ExamStatus.valueOf(record.getStatus()); } catch (final Exception e) { - log.error("Missing exam status form data base. Set ExamStatus.UP_COMING as fallback ", e); + log.error("Missing exam status from data base. Set ExamStatus.UP_COMING as fallback ", e); status = ExamStatus.UP_COMING; } @@ -766,7 +770,7 @@ public class ExamDAOImpl implements ExamDAO { record.getExternalId(), (quizData != null) ? quizData.name : Constants.EMPTY_NOTE, (quizData != null) ? quizData.description : Constants.EMPTY_NOTE, - (quizData != null) ? quizData.startTime : null, + (quizData != null) ? quizData.startTime : new DateTime(0), (quizData != null) ? quizData.endTime : null, (quizData != null) ? quizData.startURL : Constants.EMPTY_NOTE, ExamType.valueOf(record.getType()), diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/LmsAPIService.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/LmsAPIService.java index 851289d7..1dcebbe4 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/LmsAPIService.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/LmsAPIService.java @@ -106,7 +106,7 @@ public interface LmsAPIService { final boolean nameFilter = StringUtils.isBlank(name) || (q.name != null && q.name.contains(name)); final boolean startTimeFilter = (from == null) || (q.startTime != null && (q.startTime.isEqual(from) || q.startTime.isAfter(from))); - final boolean currentlyRunning = DateTime.now(DateTimeZone.UTC).isBefore(q.endTime); + final boolean currentlyRunning = q.endTime == null || DateTime.now(DateTimeZone.UTC).isBefore(q.endTime); return nameFilter && (startTimeFilter || currentlyRunning); }; }