From 5ade5ef74f04755ffe9231f71ecaf8bb43e7fbcf Mon Sep 17 00:00:00 2001 From: stetsche <53173679+stetsche@users.noreply.github.com> Date: Thu, 5 Oct 2023 15:25:05 +0200 Subject: [PATCH] SAK-49337 Add format field to lesson endpoint for BREAK type (#11968) --- .../LessonsEntityProvider.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lessonbuilder/tool/src/java/org/sakaiproject/lessonbuildertool/tool/entityproviders/LessonsEntityProvider.java b/lessonbuilder/tool/src/java/org/sakaiproject/lessonbuildertool/tool/entityproviders/LessonsEntityProvider.java index cf46aa768764..f5ef51600c83 100644 --- a/lessonbuilder/tool/src/java/org/sakaiproject/lessonbuildertool/tool/entityproviders/LessonsEntityProvider.java +++ b/lessonbuilder/tool/src/java/org/sakaiproject/lessonbuildertool/tool/entityproviders/LessonsEntityProvider.java @@ -649,6 +649,23 @@ public DecoratedResourceFolder(SimplePageItem item) { } } } + + @Data + @EqualsAndHashCode(callSuper = false) + public class DecoratedBreak extends DecoratedLesson { + + + private String format; + + + public DecoratedBreak(SimplePageItem item) { + super(item); + + if (item != null) { + format = item.getFormat(); + } + } + } // For properties related to grading a DecoratedLesson @NoArgsConstructor @@ -1007,6 +1024,9 @@ private LessonBase addItem(SimplePageItem item, List list, boolean h LessonBase lesson = null; //check type switch (item.getType()) { + case SimplePageItem.BREAK: + lesson = new DecoratedBreak(item); + break; case SimplePageItem.QUESTION: if ("multipleChoice".equals(item.getAttribute("questionType"))) { lesson = new DecoratedMultipleChoiceQuestion(item,