SEBSERV-529 fixed

This commit is contained in:
anhefti 2024-03-25 16:26:47 +01:00
parent b463e5be6c
commit 28960ddacc
2 changed files with 11 additions and 5 deletions

View file

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

View file

@ -137,8 +137,11 @@ public class MoodlePluginCourseRestriction implements SEBRestrictionAPI {
final ArrayList<String> 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);