From 6ed3817bc42afbbdfe71a9a99dadd84dbf6dba3d Mon Sep 17 00:00:00 2001 From: anhefti Date: Mon, 13 Jun 2022 09:28:26 +0200 Subject: [PATCH] fixed SEB restriction check --- .../servicelayer/exam/impl/ExamAdminServiceImpl.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/exam/impl/ExamAdminServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/exam/impl/ExamAdminServiceImpl.java index 2d38f963..d223ce4d 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/exam/impl/ExamAdminServiceImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/exam/impl/ExamAdminServiceImpl.java @@ -32,6 +32,7 @@ import ch.ethz.seb.sebserver.gbl.model.exam.ProctoringServiceSettings; import ch.ethz.seb.sebserver.gbl.model.exam.ProctoringServiceSettings.ProctoringFeature; import ch.ethz.seb.sebserver.gbl.model.exam.ProctoringServiceSettings.ProctoringServerType; import ch.ethz.seb.sebserver.gbl.model.exam.QuizData; +import ch.ethz.seb.sebserver.gbl.model.exam.SEBRestriction; import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetup; import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetup.LmsType; import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile; @@ -130,7 +131,14 @@ public class ExamAdminServiceImpl implements ExamAdminService { return this.lmsAPIService .getLmsAPITemplate(exam.lmsSetupId) - .map(lmsAPI -> !lmsAPI.getSEBClientRestriction(exam).hasError()); + .map(lmsAPI -> { + final Result sebClientRestriction = lmsAPI.getSEBClientRestriction(exam); + if (sebClientRestriction.hasError()) { + return false; + } + final SEBRestriction sebRestriction = sebClientRestriction.get(); + return !sebRestriction.configKeys.isEmpty() || !sebRestriction.browserExamKeys.isEmpty(); + }); } @Override