From 9674f08b8bd4a18b1e2327f9dd68be3ba4550c21 Mon Sep 17 00:00:00 2001 From: anhefti Date: Mon, 20 Mar 2023 09:19:55 +0100 Subject: [PATCH] SEBSERV-395 fixed message mismatch --- .../java/ch/ethz/seb/sebserver/gui/content/exam/ExamForm.java | 4 +++- .../webservice/servicelayer/lms/SEBRestrictionService.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/ExamForm.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/ExamForm.java index 276c2f7b..cda5b7c5 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/ExamForm.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/ExamForm.java @@ -253,7 +253,6 @@ public class ExamForm implements TemplateComposer { .getOr(Collections.emptyList()); if (sebRestrictionMismatch || (warnings != null && !warnings.isEmpty())) { showConsistencyChecks(warnings, sebRestrictionMismatch, formContext.getParent()); - } } @@ -654,8 +653,11 @@ public class ExamForm implements TemplateComposer { CustomVariant.TITLE_LABEL, CONSISTENCY_MESSAGE_TITLE); + final String restrMessageCode = APIMessage.ErrorMessage.EXAM_CONSISTENCY_VALIDATION_SEB_RESTRICTION.messageCode; + result .stream() + .filter(message -> !(sebRestrictionMismatch && message.messageCode.equals(restrMessageCode))) .map(message -> this.consistencyMessageMapping.get(message.messageCode)) .filter(Objects::nonNull) .forEach(message -> this.widgetFactory.labelLocalized( diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/SEBRestrictionService.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/SEBRestrictionService.java index d13a21ba..1efbfab2 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/SEBRestrictionService.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/SEBRestrictionService.java @@ -60,7 +60,7 @@ public interface SEBRestrictionService { * for the particular LMS type of the Exam. otherwise it returns true to indicate * everything is fine with SEB Restriction * - * @param exam the Exam instance to chech + * @param exam the Exam instance to check * @return false if the SEB Restriction feature is switched on for the given Exam but the restriction is not applied * to the LMS */ boolean checkSebRestrictionSet(Exam exam);