From c99922c7ef9272b00275d6b4d9b7b20cd81f02c5 Mon Sep 17 00:00:00 2001 From: anhefti Date: Thu, 15 Jun 2023 10:42:18 +0200 Subject: [PATCH] fixed exam lms availability update --- .../servicelayer/session/impl/ExamUpdateHandler.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 665e9400..033e7e5f 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 @@ -410,11 +410,14 @@ class ExamUpdateHandler { .getLmsAPITemplate(lmsSetupId) .getOrThrow(); + final Exam exam = exams.get(quizId); if (!lmsTemplate.getType().features.contains(Features.COURSE_RECOVERY)) { + if (exam.lmsAvailable == null || exam.isLmsAvailable()) { + this.examDAO.markLMSAvailability(quizId, false, updateId); + } throw new UnsupportedOperationException("No Course Recovery"); } - final Exam exam = exams.get(quizId); final int attempts = Integer.parseInt(this.additionalAttributesDAO.getAdditionalAttribute( EntityType.EXAM, exam.id,