SEBSERV-552 fixed SPS exam creation and update

This commit is contained in:
anhefti 2024-06-25 16:50:40 +02:00
parent 27542a2293
commit 7fbf49397c
2 changed files with 5 additions and 3 deletions

View file

@ -448,6 +448,8 @@ public class MoodleRestTemplateFactoryImpl implements MoodleRestTemplateFactory
} }
}); });
log.info("Upload to Moodle url: {}", uri.toString());
return super.postForObject( return super.postForObject(
uri.toString(), uri.toString(),
multiPartAttributes, multiPartAttributes,
@ -470,7 +472,7 @@ public class MoodleRestTemplateFactoryImpl implements MoodleRestTemplateFactory
if (response.getStatusCode() != HttpStatus.OK) { if (response.getStatusCode() != HttpStatus.OK) {
throw new RuntimeException( throw new RuntimeException(
"Failed to call Moodle webservice API function: " + functionName + " lms setup: " + "Failed to call Moodle webservice API function: " + functionName + " lms setup: " +
lmsSetup + " response: " + response.getBody()); lmsSetup.name + " response: " + response.getBody());
} }
final String body = response.getBody(); final String body = response.getBody();
@ -488,7 +490,7 @@ public class MoodleRestTemplateFactoryImpl implements MoodleRestTemplateFactory
this.accessToken = null; this.accessToken = null;
log.warn( log.warn(
"Failed to call Moodle webservice API function: {} lms setup: {} response: {}", "Failed to call Moodle webservice API function: {} lms setup: {} response: {}",
functionName, lmsSetup, body); functionName, lmsSetup.name, body);
} }
return body; return body;

View file

@ -295,7 +295,7 @@ public class ScreenProctoringServiceImpl implements ScreenProctoringService {
@Override @Override
public void notifyExamStarted(final ExamStartedEvent event) { public void notifyExamStarted(final ExamStartedEvent event) {
final Exam exam = event.exam; final Exam exam = event.exam;
if (!BooleanUtils.toBoolean(exam.additionalAttributes.get(SPSData.ATTR_SPS_ACTIVE))) { if (BooleanUtils.toBoolean(exam.additionalAttributes.get(SPSData.ATTR_SPS_ACTIVE))) {
return; return;
} }