From ed48fad27c5d25104712df395d10597f4a0d4b8e Mon Sep 17 00:00:00 2001 From: anhefti Date: Wed, 21 Aug 2024 12:07:31 +0200 Subject: [PATCH] SEBSERV-581 fixed (skip for none LMS Exams) --- src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/Exam.java | 2 +- .../java/ch/ethz/seb/sebserver/gui/content/exam/ExamList.java | 2 +- .../webservice/servicelayer/session/impl/ExamUpdateHandler.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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) {