From a22fc8ddb40f8533752ad01621837c001ac00859 Mon Sep 17 00:00:00 2001 From: myluki2000 Date: Fri, 11 Oct 2024 18:30:22 +0200 Subject: [PATCH] AssessmentContentMutatedEvent change format Instead of passing list of strings for textual representation, pass list of taskinformation with textual information & task ID --- .../event/AssessmentContentMutatedEvent.java | 59 ++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/unistuttgart/iste/meitrex/common/event/AssessmentContentMutatedEvent.java b/src/main/java/de/unistuttgart/iste/meitrex/common/event/AssessmentContentMutatedEvent.java index 6cdc466..8f070d0 100644 --- a/src/main/java/de/unistuttgart/iste/meitrex/common/event/AssessmentContentMutatedEvent.java +++ b/src/main/java/de/unistuttgart/iste/meitrex/common/event/AssessmentContentMutatedEvent.java @@ -14,8 +14,65 @@ @NoArgsConstructor @AllArgsConstructor public class AssessmentContentMutatedEvent { + /** + * ID of the course the assessment belongs to. + */ private UUID courseId; + /** + * ID of the assessment this event is about. + */ private UUID assessmentId; + /** + * Type of the assessment. + */ private AssessmentType assessmentType; - private List textualRepresentation; + /** + * List containing information about the tasks this assessment consists of. + * + * What exactly constitutes a "task" is implementation-specific for the different types of assessments. It should + * just be consistent within one assessment type. E.g. for quizzes each question can be a task, and for flashcards + * each flashcard can be a task. + */ + private List taskInformationList; + + @Data + @AllArgsConstructor + public static class TaskInformation { + /** + * ID of this task of the assessment. Exactly what entity this ID references can be freely chosen and is + * implementation-specific for the different types of assessments, but it should be the ID of the entity this + * task represents, e.g. if we have a quiz and decided that each question is a separate task, then the ID of the + * task should be the ID of the question entity in our quiz service. + */ + private UUID taskId; + /** + *

+ * The purpose of this field is to provide the contents of this task in a simple textual format for other + * services to use without having to have any assessment-specific code. + *

+ * There is no exact formatting guideline for the textual representation. Its purpose is to just provide a very + * basic means to fetch assessments’ contents in textual form, e.g. for performing a search or similar purposes. + *

+ * The textual representation can contain spoilers, so it should never be shown to students. + *

+ * A good textual representation may look like the following for example, for a quiz: + *

+ * String 1: + *

+         * Question: How tall is the Eiffel Tower?
+         * Correct Answer: 330m
+         * 
+ * String 2: + *
+         * Question: What colors make up the French flag?
+         * Correct Answer: blue, white, and red
+         * 
+ * String 3: + *
+         * Task: Fill in the gaps in the text:
+         * King Luis XIV famously said: "L'[etat], c'est [moi]!"
+         * 
+ */ + private String textualRepresentation; + } }