Skip to content

Allow hints to generate content errors - #827

Merged
sjd210 merged 2 commits into
mainfrom
improvement/enable-hint-content-errors
Aug 26, 2026
Merged

Allow hints to generate content errors#827
sjd210 merged 2 commits into
mainfrom
improvement/enable-hint-content-errors

Conversation

@jacbn

@jacbn jacbn commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

I would appreciate some discussion on whether this is the right place to do this. This modifies the unpacking inside flattenContentObjects to include hints, alongside children and inline question regions. This seems to work fine, but does mean the ETL process considers more objects than before and now, for example, may not throw a content error if the only question part in a question is located inside a hint. The editor of course forbids this and other silly edge cases, so I am not worried by just this – but there may be more problematic cases that I have missed.

@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 41.68%. Comparing base (8822b76) to head (625704d).
⚠️ Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
...ava/uk/ac/cam/cl/dtg/segue/etl/ContentIndexer.java 0.00% 15 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #827      +/-   ##
==========================================
+ Coverage   41.08%   41.68%   +0.59%     
==========================================
  Files         550      550              
  Lines       23629    23687      +58     
  Branches     2855     2869      +14     
==========================================
+ Hits         9709     9874     +165     
+ Misses      13044    12918     -126     
- Partials      876      895      +19     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sjd210 sjd210 left a comment

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.

I think this is fine. We already don't rely on the content errors as a perfect list of things that are wrong with the content, and anything weird that this could introduce (either now, or with new errors in the future) is pretty explicitly an odd case that should be treated as exceptional.

This works for what we want it for, so I think its good! 👍

@sjd210 sjd210 left a comment

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.

I still think this is fine in principle, but just spotted something for before this gets merged.

setOfContentObjects.addAll(flattenContentObjects((Content) 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.

@sjd210
sjd210 merged commit 3f887a1 into main Aug 26, 2026
5 checks passed
@sjd210
sjd210 deleted the improvement/enable-hint-content-errors branch August 26, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants