SEBSERV-417 try fix corrupt Moodle data
This commit is contained in:
parent
1ef62af9a5
commit
3a5129f796
2 changed files with 9 additions and 10 deletions
|
@ -145,7 +145,15 @@ public class FullLmsIntegrationServiceImpl implements FullLmsIntegrationService
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result<Exam> applyExamDataToLMS(final Exam exam) {
|
public Result<Exam> applyExamDataToLMS(final Exam exam) {
|
||||||
return Result.tryCatch(() -> this.applyExamData(exam, false));
|
return Result.tryCatch(() -> {
|
||||||
|
final LmsSetup lmsSetup = lmsSetupDAO.byPK(exam.lmsSetupId).getOrThrow();
|
||||||
|
if (lmsSetup.lmsType.features.contains(LmsSetup.Features.LMS_FULL_INTEGRATION)) {
|
||||||
|
return this.applyExamData(exam, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
return exam;
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -733,15 +733,6 @@ public class ExamAdministrationController extends EntityController<Exam, Exam> {
|
||||||
|
|
||||||
return this.checkNoActiveSEBClientConnections(exam)
|
return this.checkNoActiveSEBClientConnections(exam)
|
||||||
.flatMap(this.sebRestrictionService::applySEBClientRestriction)
|
.flatMap(this.sebRestrictionService::applySEBClientRestriction)
|
||||||
// TODO temporary try to fix corrupted data on Moodle site
|
|
||||||
.onErrorDo(error -> {
|
|
||||||
if (error.getMessage().contains("no SebServer Info!")) {
|
|
||||||
log.info("**** try to reset exam_data on Moodle 2.0 with temporary hack... ");
|
|
||||||
fullLmsIntegrationService.applyExamDataToLMS(exam)
|
|
||||||
.onError(e -> log.error("Failed to apply exam data: ", error));
|
|
||||||
}
|
|
||||||
return this.sebRestrictionService.applySEBClientRestriction(exam).getOrThrow();
|
|
||||||
})
|
|
||||||
.flatMap(e -> this.examDAO.setSEBRestriction(exam.id, restrict))
|
.flatMap(e -> this.examDAO.setSEBRestriction(exam.id, restrict))
|
||||||
.getOrThrow();
|
.getOrThrow();
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue