Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iris: Add links to citations for lecture questions #9019

Merged
merged 11 commits into from
Dec 10, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,16 @@ private PyrisLectureUnitWebhookDTO processAttachmentForUpdate(AttachmentUnit att
String courseTitle = attachmentUnit.getLecture().getCourse().getTitle();
String courseDescription = attachmentUnit.getLecture().getCourse().getDescription() == null ? "" : attachmentUnit.getLecture().getCourse().getDescription();
String base64EncodedPdf = attachmentToBase64(attachmentUnit);
String lectureUnitLink = artemisBaseUrl + attachmentUnit.getAttachment().getLink();
lectureUnitRepository.save(attachmentUnit);
return new PyrisLectureUnitWebhookDTO(base64EncodedPdf, lectureUnitId, lectureUnitName, lectureId, lectureTitle, courseId, courseTitle, courseDescription);
return new PyrisLectureUnitWebhookDTO(base64EncodedPdf, lectureUnitId, lectureUnitName, lectureId, lectureTitle, courseId, courseTitle, courseDescription, lectureUnitLink);
}

private PyrisLectureUnitWebhookDTO processAttachmentForDeletion(AttachmentUnit attachmentUnit) {
Long lectureUnitId = attachmentUnit.getId();
Long lectureId = attachmentUnit.getLecture().getId();
Long courseId = attachmentUnit.getLecture().getCourse().getId();
return new PyrisLectureUnitWebhookDTO("", lectureUnitId, "", lectureId, "", courseId, "", "");
return new PyrisLectureUnitWebhookDTO("", lectureUnitId, "", lectureId, "", courseId, "", "", "");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* providing necessary details such as lecture and course identifiers, names, and descriptions.
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY)

public record PyrisLectureUnitWebhookDTO(String pdfFile, long lectureUnitId, String lectureUnitName, long lectureId, String lectureName, long courseId, String courseName,
String courseDescription) {
String courseDescription, String lectureUnitLink) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void testExceptionV2(int httpStatus, Class<?> exceptionClass) {
void testExceptionIngestionV2(int httpStatus, Class<?> exceptionClass) {
irisRequestMockProvider.mockIngestionWebhookRunError(httpStatus);
PyrisLectureUnitWebhookDTO pyrisLectureUnitWebhookDTO = new PyrisLectureUnitWebhookDTO("example.pdf", 123L, "Lecture Unit Name", 456L, "Lecture Name", 789L, "Course Name",
"Course Description");
"Course Description", "/example/test.pdf");
PyrisWebhookLectureIngestionExecutionDTO executionDTO = new PyrisWebhookLectureIngestionExecutionDTO(pyrisLectureUnitWebhookDTO, null, List.of());
assertThatThrownBy(() -> pyrisConnectorService.executeLectureAddtionWebhook("fullIngestion", executionDTO)).isInstanceOf(exceptionClass);
}
Expand Down
Loading