made moodle exam recovery optinal
This commit is contained in:
parent
df13b4dff1
commit
d866b219fa
1 changed files with 5 additions and 2 deletions
|
@ -56,6 +56,7 @@ class ExamUpdateHandler {
|
||||||
private final LmsAPIService lmsAPIService;
|
private final LmsAPIService lmsAPIService;
|
||||||
private final String updatePrefix;
|
private final String updatePrefix;
|
||||||
private final Long examTimeSuffix;
|
private final Long examTimeSuffix;
|
||||||
|
private final boolean tryRecoverExam;
|
||||||
|
|
||||||
public ExamUpdateHandler(
|
public ExamUpdateHandler(
|
||||||
final ExamDAO examDAO,
|
final ExamDAO examDAO,
|
||||||
|
@ -63,7 +64,8 @@ class ExamUpdateHandler {
|
||||||
final SEBRestrictionService sebRestrictionService,
|
final SEBRestrictionService sebRestrictionService,
|
||||||
final LmsAPIService lmsAPIService,
|
final LmsAPIService lmsAPIService,
|
||||||
final WebserviceInfo webserviceInfo,
|
final WebserviceInfo webserviceInfo,
|
||||||
@Value("${sebserver.webservice.api.exam.time-suffix:3600000}") final Long examTimeSuffix) {
|
@Value("${sebserver.webservice.api.exam.time-suffix:3600000}") final Long examTimeSuffix,
|
||||||
|
@Value("${sebserver.webservice.api.exam.tryrecover:false}") final boolean tryRecoverExam) {
|
||||||
|
|
||||||
this.examDAO = examDAO;
|
this.examDAO = examDAO;
|
||||||
this.applicationEventPublisher = applicationEventPublisher;
|
this.applicationEventPublisher = applicationEventPublisher;
|
||||||
|
@ -72,6 +74,7 @@ class ExamUpdateHandler {
|
||||||
this.updatePrefix = webserviceInfo.getLocalHostAddress()
|
this.updatePrefix = webserviceInfo.getLocalHostAddress()
|
||||||
+ "_" + webserviceInfo.getServerPort() + "_";
|
+ "_" + webserviceInfo.getServerPort() + "_";
|
||||||
this.examTimeSuffix = examTimeSuffix;
|
this.examTimeSuffix = examTimeSuffix;
|
||||||
|
this.tryRecoverExam = tryRecoverExam;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SEBRestrictionService getSEBRestrictionService() {
|
public SEBRestrictionService getSEBRestrictionService() {
|
||||||
|
@ -158,7 +161,7 @@ class ExamUpdateHandler {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!failedOrMissing.isEmpty()) {
|
if (!failedOrMissing.isEmpty() && this.tryRecoverExam) {
|
||||||
new HashSet<>(failedOrMissing).stream()
|
new HashSet<>(failedOrMissing).stream()
|
||||||
.forEach(quizId -> tryRecoverQuizData(quizId, lmsSetupId, exams, updateId)
|
.forEach(quizId -> tryRecoverQuizData(quizId, lmsSetupId, exams, updateId)
|
||||||
.onSuccess(quizData -> failedOrMissing.remove(quizId)));
|
.onSuccess(quizData -> failedOrMissing.remove(quizId)));
|
||||||
|
|
Loading…
Reference in a new issue