From fb11423cceadfd66b25f380b8a4d923ccc4eafdd Mon Sep 17 00:00:00 2001 From: anhefti Date: Mon, 5 Oct 2020 16:39:33 +0200 Subject: [PATCH] Exam shall be shown even if quiz data cannot be get from LMS --- .../servicelayer/dao/impl/ExamDAOImpl.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) 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 a57046af..d36c9b66 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 @@ -796,10 +796,6 @@ public class ExamDAOImpl implements ExamDAO { final ExamRecord record, final QuizData quizData) { - if (quizData == null) { - return Result.ofRuntimeError("No quizData found for exam: " + record); - } - return Result.tryCatch(() -> { final Collection supporter = (StringUtils.isNotBlank(record.getSupporter())) @@ -819,11 +815,11 @@ public class ExamDAOImpl implements ExamDAO { record.getInstitutionId(), record.getLmsSetupId(), record.getExternalId(), - quizData.name, - quizData.description, - quizData.startTime, - quizData.endTime, - quizData.startURL, + (quizData != null) ? quizData.name : "[Failed to load quiz data]", + (quizData != null) ? quizData.description : "[Failed to load quiz data]", + (quizData != null) ? quizData.startTime : null, + (quizData != null) ? quizData.endTime : null, + (quizData != null) ? quizData.startURL : Constants.EMPTY_NOTE, ExamType.valueOf(record.getType()), record.getOwner(), supporter,