SEBSERV-417 try fix corrupt Moodle data
This commit is contained in:
parent
7a3e3a2492
commit
1ef62af9a5
3 changed files with 6 additions and 1 deletions
|
@ -317,7 +317,7 @@ public class ExamRecordDAO {
|
||||||
.set(quitPassword).equalTo(getEncryptedQuitPassword(exam.quitPassword))
|
.set(quitPassword).equalTo(getEncryptedQuitPassword(exam.quitPassword))
|
||||||
.set(browserKeys).equalToWhenPresent(exam.browserExamKeys)
|
.set(browserKeys).equalToWhenPresent(exam.browserExamKeys)
|
||||||
.set(lmsSebRestriction).equalTo(1) // seb restriction (deprecated)
|
.set(lmsSebRestriction).equalTo(1) // seb restriction (deprecated)
|
||||||
.set(examTemplateId).equalTo(exam.examTemplateId)
|
.set(examTemplateId).equalTo(oldRecord.getExamTemplateId())
|
||||||
.set(lastModified).equalTo(Utils.getMillisecondsNow())
|
.set(lastModified).equalTo(Utils.getMillisecondsNow())
|
||||||
.set(quizName).equalToWhenPresent(exam.lmsSetupId == null ? exam.name : null)
|
.set(quizName).equalToWhenPresent(exam.lmsSetupId == null ? exam.name : null)
|
||||||
.set(quizStartTime).equalToWhenPresent(exam.lmsSetupId == null ? exam.startTime : null)
|
.set(quizStartTime).equalToWhenPresent(exam.lmsSetupId == null ? exam.startTime : null)
|
||||||
|
|
|
@ -541,6 +541,10 @@ public class FullLmsIntegrationServiceImpl implements FullLmsIntegrationService
|
||||||
}
|
}
|
||||||
|
|
||||||
private Exam applyExamData(final Exam exam, final boolean deletion) {
|
private Exam applyExamData(final Exam exam, final boolean deletion) {
|
||||||
|
if (exam.examTemplateId == null) {
|
||||||
|
throw new IllegalStateException("Exam has no template id: " + exam.getName());
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
final LmsAPITemplate lmsAPITemplate = lmsAPITemplateCacheService
|
final LmsAPITemplate lmsAPITemplate = lmsAPITemplateCacheService
|
||||||
|
|
|
@ -622,6 +622,7 @@ public class ExamAdministrationController extends EntityController<Exam, Exam> {
|
||||||
protected Result<Exam> notifySaved(final Exam entity) {
|
protected Result<Exam> notifySaved(final Exam entity) {
|
||||||
return this.examAdminService.notifyExamSaved(entity)
|
return this.examAdminService.notifyExamSaved(entity)
|
||||||
.flatMap(this.examAdminService::applyQuitPassword)
|
.flatMap(this.examAdminService::applyQuitPassword)
|
||||||
|
.flatMap(this.fullLmsIntegrationService::applyExamDataToLMS)
|
||||||
.flatMap(this.examSessionService::flushCache);
|
.flatMap(this.examSessionService::flushCache);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue