diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/Exam.java b/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/Exam.java index 1750e26a..0eaa0682 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/Exam.java +++ b/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/Exam.java @@ -30,7 +30,6 @@ public final class Exam implements GrantEntity, Activatable { public static final String ATTR_STATUS = "examStatus"; public static final String FILTER_ATTR_TYPE = "type"; - public static final String FILTER_ATTR_FROM = "from"; public enum ExamStatus { UP_COMING, diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/QuizDiscoveryList.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/QuizDiscoveryList.java index 53850e23..41450451 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/content/QuizDiscoveryList.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/QuizDiscoveryList.java @@ -179,9 +179,9 @@ public class QuizDiscoveryList implements TemplateComposer { private PageAction importQuizData(final PageAction action, final EntityTable table) { final QuizData selectedROWData = table.getSelectedROWData(); - if (selectedROWData.endTime != null) { + if (selectedROWData.startTime != null) { final DateTime now = DateTime.now(DateTimeZone.UTC); - if (selectedROWData.endTime.isBefore(now)) { + if (selectedROWData.startTime.isBefore(now)) { throw new PageMessageException(NO_IMPORT_OF_OUT_DATED_QUIZ); } } diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/FilterMap.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/FilterMap.java index a62689b3..c4aa5f0c 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/FilterMap.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/FilterMap.java @@ -18,7 +18,6 @@ import ch.ethz.seb.sebserver.gbl.model.exam.Exam; import ch.ethz.seb.sebserver.gbl.model.exam.Indicator; import ch.ethz.seb.sebserver.gbl.model.exam.QuizData; import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetup; -import ch.ethz.seb.sebserver.gbl.model.institution.SebClientConfig; import ch.ethz.seb.sebserver.gbl.model.user.UserInfo; import ch.ethz.seb.sebserver.gbl.util.Utils; @@ -79,11 +78,11 @@ public class FilterMap extends POSTMapper { } public DateTime getExamFromTime() { - return Utils.toDateTime(getString(Exam.FILTER_ATTR_FROM)); + return Utils.toDateTime(getString(QuizData.FILTER_ATTR_START_TIME)); } public DateTime getSebClientConfigFromTime() { - return Utils.toDateTime(getString(SebClientConfig.FILTER_ATTR_FROM)); + return getQuizFromTime(); } public Long getLmsSetupId() { 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 62a54972..3189fc1c 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 @@ -100,7 +100,7 @@ public class ExamDAOImpl implements ExamDAO { return Result.tryCatch(() -> { - final String name = filterMap.getName(); + final String name = filterMap.getQuizName(); final DateTime from = filterMap.getExamFromTime(); final Predicate quizDataFilter = exam -> { if (StringUtils.isNoneBlank(name)) {