From 0fb7581accae3aca9781a582e1a7e54420a511ba Mon Sep 17 00:00:00 2001 From: anhefti Date: Mon, 9 Jan 2023 10:31:59 +0100 Subject: [PATCH] fixed minor in quiz data update for empty descriptions --- .../sebserver/webservice/servicelayer/dao/impl/ExamDAOImpl.java | 2 ++ .../webservice/servicelayer/session/impl/ExamUpdateHandler.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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 5c2994e2..cb9edf43 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 @@ -761,6 +761,8 @@ public class ExamDAOImpl implements ExamDAO { final Map additionalAttributes = new HashMap<>(quizData.getAdditionalAttributes()); if (StringUtils.isNotBlank(quizData.description)) { additionalAttributes.put(QuizData.QUIZ_ATTR_DESCRIPTION, quizData.description); + } else { + additionalAttributes.put(QuizData.QUIZ_ATTR_DESCRIPTION, StringUtils.EMPTY); } if (StringUtils.isNotBlank(quizData.startURL)) { additionalAttributes.put(QuizData.QUIZ_ATTR_START_URL, quizData.startURL); 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 709f362b..8726af84 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 @@ -393,7 +393,7 @@ class ExamUpdateHandler { if (attempts >= this.recoverAttempts) { if (log.isDebugEnabled()) { - log.debug("Skip recovering quiz due to too many attempts: {}", exam.getModelId()); + log.debug("Skip recovering quiz due to too many attempts for exam: {}", exam.getModelId()); throw new RuntimeException("Recover attempts reached"); } }