SEBSERV-155 removed mandatory supporter application and check

This commit is contained in:
anhefti 2022-02-07 17:08:01 +01:00
parent dbcb5a9a41
commit 94c04805e0
3 changed files with 6 additions and 6 deletions

View file

@ -13,7 +13,6 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Map;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.apache.commons.lang3.StringUtils;
@ -115,7 +114,6 @@ public final class Exam implements GrantEntity {
public final String owner;
@JsonProperty(EXAM.ATTR_SUPPORTER)
@NotEmpty(message = "exam:supporter:notNull")
public final Collection<String> supporter;
@JsonProperty(EXAM.ATTR_STATUS)

View file

@ -357,7 +357,7 @@ public class ExamForm implements TemplateComposer {
.withLabelSpan(2)
.withInputSpan(4)
.withEmptyCellSpan(2)
.mandatory(!readonly))
.readonly(!importFromQuizData))
.addField(FormBuilder.singleSelection(
Domain.EXAM.ATTR_TYPE,
@ -376,8 +376,7 @@ public class ExamForm implements TemplateComposer {
this.resourceService::examSupporterResources)
.withLabelSpan(2)
.withInputSpan(4)
.withEmptyCellSpan(2)
.mandatory(!readonly))
.withEmptyCellSpan(2))
.buildFor(importFromQuizData
? this.restService.getRestCall(ImportAsExam.class)

View file

@ -63,6 +63,7 @@ public class ExamSessionServiceImpl implements ExamSessionService {
private final ExamConfigurationMapDAO examConfigurationMapDAO;
private final CacheManager cacheManager;
private final SEBRestrictionService sebRestrictionService;
private final boolean checkExamSupporter;
private final boolean distributedSetup;
private final long distributedConnectionUpdate;
@ -76,6 +77,7 @@ public class ExamSessionServiceImpl implements ExamSessionService {
final IndicatorDAO indicatorDAO,
final CacheManager cacheManager,
final SEBRestrictionService sebRestrictionService,
@Value("${sebserver.webservice.exam.check.supporter:false}") final boolean checkExamSupporter,
@Value("${sebserver.webservice.distributed:false}") final boolean distributedSetup,
@Value("${sebserver.webservice.distributed.connectionUpdate:2000}") final long distributedConnectionUpdate) {
@ -86,6 +88,7 @@ public class ExamSessionServiceImpl implements ExamSessionService {
this.cacheManager = cacheManager;
this.indicatorDAO = indicatorDAO;
this.sebRestrictionService = sebRestrictionService;
this.checkExamSupporter = checkExamSupporter;
this.distributedSetup = distributedSetup;
this.distributedConnectionUpdate = distributedConnectionUpdate;
}
@ -136,7 +139,7 @@ public class ExamSessionServiceImpl implements ExamSessionService {
if (exam.status == ExamStatus.RUNNING) {
// check exam supporter
if (exam.getSupporter().isEmpty()) {
if (this.checkExamSupporter && exam.getSupporter().isEmpty()) {
result.add(ErrorMessage.EXAM_CONSISTENCY_VALIDATION_SUPPORTER.of(exam.getModelId()));
}