From b0617803f19298178a1b056525f44b8f6e26ba15 Mon Sep 17 00:00:00 2001 From: anhefti Date: Mon, 1 Jul 2024 11:32:38 +0200 Subject: [PATCH] SEBSERV-555 should be fixed, testing on ralph --- .../lms/impl/FullLmsIntegrationServiceImpl.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/FullLmsIntegrationServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/FullLmsIntegrationServiceImpl.java index c71d4da1..3817252c 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/FullLmsIntegrationServiceImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/FullLmsIntegrationServiceImpl.java @@ -556,9 +556,6 @@ public class FullLmsIntegrationServiceImpl implements FullLmsIntegrationService if (!hasFullIntegration(exam.lmsSetupId)) { return exam; } - if (exam.examTemplateId == null) { - throw new IllegalStateException("Exam has no template id: " + exam.getName()); - } try { @@ -569,7 +566,11 @@ public class FullLmsIntegrationServiceImpl implements FullLmsIntegrationService final String courseId = lmsAPITemplate.getCourseIdFromExam(exam); final String quizId = lmsAPITemplate.getQuizIdFromExam(exam); - final String templateId = deletion ? null : String.valueOf(exam.examTemplateId); + final String templateId = deletion + ? null + : exam.examTemplateId != null + ? String.valueOf(exam.examTemplateId) + : null; final String quitPassword = deletion ? null : examConfigurationValueService.getQuitPassword(exam.id); final String quitLink = deletion ? null : examConfigurationValueService.getQuitLink(exam.id);