SEBSERV-395 fixed message mismatch

This commit is contained in:
anhefti 2023-03-20 09:19:55 +01:00
parent 0cf883ecf3
commit 9674f08b8b
2 changed files with 4 additions and 2 deletions

View file

@ -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(

View file

@ -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);