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 465a258b..8127b9a2 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 @@ -363,7 +363,7 @@ public final class Exam implements GrantEntity { @JsonIgnore public boolean isLmsAvailable() { - return BooleanUtils.isTrue(this.lmsAvailable); + return BooleanUtils.isNotFalse(this.lmsAvailable); } public String getExternalId() { diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/ExamList.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/ExamList.java index 7ceb339a..f7edff85 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/ExamList.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/ExamList.java @@ -336,7 +336,7 @@ public class ExamList implements TemplateComposer { final Exam exam, final PageService pageService) { - if (BooleanUtils.isFalse(exam.isLmsAvailable())) { + if (exam.lmsSetupId != null && BooleanUtils.isFalse(exam.isLmsAvailable())) { item.setData(RWT.CUSTOM_VARIANT, CustomVariant.DISABLED.key); return; } diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamUpdateHandler.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamUpdateHandler.java index 208109f0..0fd16c53 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamUpdateHandler.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamUpdateHandler.java @@ -146,7 +146,7 @@ class ExamUpdateHandler implements ExamUpdateTask { .forEach(quizId -> { try { final Exam exam = exams.get(quizId); - if (exam.lmsAvailable == null || exam.isLmsAvailable()) { + if (exam.lmsSetupId != null && (exam.lmsAvailable == null || exam.isLmsAvailable())) { this.examDAO.markLMSAvailability(quizId, false, updateId); } } catch (final Exception ee) {