Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions src/main/java/uk/ac/cam/cl/dtg/segue/etl/ContentIndexer.java
Original file line number Diff line number Diff line change
Expand Up @@ -554,9 +554,28 @@ public static Set<Content> flattenContentObjects(final Content content) {
setOfContentObjects.addAll(flattenContentObjects((Content) child));
}

if (content instanceof InlineRegion) {
for (IsaacQuestionBase child : ((InlineRegion) content).getInlineQuestions()) {
setOfContentObjects.addAll(flattenContentObjects(child));
if (content instanceof IsaacQuestionBase question) {

@sjd210 sjd210 Aug 26, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hints don't just exist on a Question, they can also be part of an InlineRegion - so we ought to also add this logic to the if statement below this as well. e.g. See sjd_inline_region_no_questions

@jacbn jacbn Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot! I've also aligned the inlineQuestions loop to include a null-check, just in case.

List<ContentBase> hints = question.getHints();
if (hints != null) {
for (ContentBase hint : hints) {
setOfContentObjects.addAll(flattenContentObjects((Content) hint));
}
}
}

if (content instanceof InlineRegion region) {
List<IsaacQuestionBase> inlineQuestions = region.getInlineQuestions();
if (inlineQuestions != null) {
for (IsaacQuestionBase child : inlineQuestions) {
setOfContentObjects.addAll(flattenContentObjects(child));
}
}

List<ContentBase> hints = region.getHints();
if (hints != null) {
for (ContentBase hint : hints) {
setOfContentObjects.addAll(flattenContentObjects((Content) hint));
}
}
}
}
Expand Down