diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/SEBRestrictionServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/SEBRestrictionServiceImpl.java index 758203b4..f9d42be0 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/SEBRestrictionServiceImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/SEBRestrictionServiceImpl.java @@ -148,9 +148,12 @@ public class SEBRestrictionServiceImpl implements SEBRestrictionService { // special Moodle plugin case for ADDITIONAL_ATTR_ALTERNATIVE_SEB_BEK this.lmsAPIService.getLmsSetup(exam.lmsSetupId).map(lms -> { if (lms.lmsType == LmsType.MOODLE_PLUGIN) { - additionalAttributes.put( - MoodleSEBRestriction.ATTR_ALT_BEK, - exam.getAdditionalAttribute(ADDITIONAL_ATTR_ALTERNATIVE_SEB_BEK)); + final AdditionalAttributeRecord attr = this.additionalAttributesDAO.getAdditionalAttribute( + EntityType.EXAM, + exam.id, + ADDITIONAL_ATTR_ALTERNATIVE_SEB_BEK) + .getOrThrow(); + additionalAttributes.put(MoodleSEBRestriction.ATTR_ALT_BEK, attr.getValue()); } return lms; }); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/plugin/MoodlePluginCourseRestriction.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/plugin/MoodlePluginCourseRestriction.java index 85cb6025..38dd7ade 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/plugin/MoodlePluginCourseRestriction.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/plugin/MoodlePluginCourseRestriction.java @@ -137,8 +137,11 @@ public class MoodlePluginCourseRestriction implements SEBRestrictionAPI { final ArrayList configKeys = new ArrayList<>(sebRestrictionData.configKeys); final String quitLink = this.examConfigurationValueService.getQuitLink(exam.id); final String quitSecret = this.examConfigurationValueService.getQuitPassword(exam.id); - final String additionalBEK = exam.getAdditionalAttribute( - SEBRestrictionService.ADDITIONAL_ATTR_ALTERNATIVE_SEB_BEK); + String additionalBEK = sebRestrictionData.additionalProperties.get(SEBRestrictionService.ADDITIONAL_ATTR_ALTERNATIVE_SEB_BEK); + if (additionalBEK == null) { + additionalBEK = exam.getAdditionalAttribute( + SEBRestrictionService.ADDITIONAL_ATTR_ALTERNATIVE_SEB_BEK); + } if (additionalBEK != null && !beks.contains(additionalBEK)) { beks.add(additionalBEK);