SEBSERV-553 fixed show quit link and improved logging

This commit is contained in:
anhefti 2024-06-25 10:20:27 +02:00
parent 8b30771021
commit b808d65f53

View file

@ -23,6 +23,7 @@ import ch.ethz.seb.sebserver.webservice.WebserviceInfo;
import ch.ethz.seb.sebserver.webservice.servicelayer.lms.FullLmsIntegrationService; import ch.ethz.seb.sebserver.webservice.servicelayer.lms.FullLmsIntegrationService;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@ -61,16 +62,24 @@ public class LmsIntegrationController {
@RequestParam(name = API.LMS_FULL_INTEGRATION_EXAM_TEMPLATE_ID) final String templateId, @RequestParam(name = API.LMS_FULL_INTEGRATION_EXAM_TEMPLATE_ID) final String templateId,
@RequestParam(name = API.LMS_FULL_INTEGRATION_EXAM_DATA, required = false) final String examData, @RequestParam(name = API.LMS_FULL_INTEGRATION_EXAM_DATA, required = false) final String examData,
@RequestParam(name = API.LMS_FULL_INTEGRATION_QUIT_PASSWORD, required = false) final String quitPassword, @RequestParam(name = API.LMS_FULL_INTEGRATION_QUIT_PASSWORD, required = false) final String quitPassword,
@RequestParam(name = API.LMS_FULL_INTEGRATION_QUIT_LINK, required = false) final int quitLink, @RequestParam(name = API.LMS_FULL_INTEGRATION_QUIT_LINK, required = false) final Integer quitLink,
final HttpServletResponse response) { final HttpServletResponse response) {
log.info("Importing exam from LMS call. lmsUUId: {} courseId: {} quizId: {} templateId: {} quitPassword: {} quitLink: {}",
lmsUUId,
courseId,
quizId,
templateId,
StringUtils.isNotBlank(quitPassword) ? "yes" : "no",
quitLink);
final Exam exam = fullLmsIntegrationService.importExam( final Exam exam = fullLmsIntegrationService.importExam(
lmsUUId, lmsUUId,
courseId, courseId,
quizId, quizId,
templateId, templateId,
quitPassword, quitPassword,
BooleanUtils.toBoolean(quitLink), BooleanUtils.toBooleanObject(quitLink),
examData) examData)
.onError(e -> { .onError(e -> {
log.error( log.error(