Preserve imsss and adlseq objectives as separate containers#552
Merged
Conversation
Jackson XML binding collapsed same-local-name objectives elements, so an adlseq:objectives block overwrote the imsss:objectives container when both were present: the IMS primaryObjective (and its mapInfo targets) was silently lost and the ADL maps were bound through the IMS mapping type, dropping the score and progress flags. This broke SCORM 2004 packages that declare both containers for the same objectiveID (ADL CTS OB-10a among them). - New ADLObjectives/ADLObjective container models adlseq:objectives faithfully, with the full adlseq map flag set (raw/min/max score, completion, progress measure; schema defaults reads true, writes false). - Scorm2004Parser restores the IMS and ADL containers namespace-aware after the Jackson parse. - Sequencing.getAdlObjectives() returns the ADL container; the IMS primaryObjective survives with its own mapInfo. - Global objective ID collection is additive across both containers. Regression tests cover same-ID dual declarations, flag round-tripping, and schema defaults.
Contributor
📊 Benchmark ResultsTriggered by workflow run.
✅ All benchmarks passed performance thresholds. |
There was a problem hiding this comment.
Pull request overview
This PR fixes a SCORM 2004 sequencing parsing regression where Jackson XML binding collapses same-local-name objectives elements, causing adlseq:objectives to overwrite imsss:objectives (and silently lose IMS primaryObjective mappings). It restores namespace-aware handling so IMS and ADL objective containers can coexist correctly and ensures global objective ID collection is additive across both containers.
Changes:
- Introduces an ADL-specific objectives container model (
ADLObjectives) and updates sequencing usage detection/tests to use it. - Adds a post-Jackson DOM pass in
Scorm2004Parserto restore IMS vs ADL sequencing objectives based on XML namespaces. - Updates global objective ID collection in both
Scorm2004ManifestandScorm2004Metadatato aggregate mappings from IMS objectives and ADL objectives.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/java/dev/jcputney/elearning/parser/input/scorm2004/SequencingUsageDetectorTest.java | Updates test setup to use the ADL objectives container model. |
| src/test/java/dev/jcputney/elearning/parser/input/scorm2004/ims/ss/objective/Scorm2004ObjectiveParserTest.java | Adds regression + round-trip/defaulting tests for dual IMS/ADL objectives and ADL map flags. |
| src/main/java/dev/jcputney/elearning/parser/parsers/Scorm2004Parser.java | Restores namespace-distinct objective containers after Jackson parsing via a namespace-aware DOM pass. |
| src/main/java/dev/jcputney/elearning/parser/output/metadata/scorm2004/Scorm2004Metadata.java | Collects global objective IDs from both IMS and ADL objective mappings. |
| src/main/java/dev/jcputney/elearning/parser/input/scorm2004/SequencingUsageDetector.java | Detects sequencing usage based on presence of ADL objectives container content. |
| src/main/java/dev/jcputney/elearning/parser/input/scorm2004/Scorm2004Manifest.java | Updates global objective ID collection to include ADL mapInfo targets as well as IMS mappings. |
| src/main/java/dev/jcputney/elearning/parser/input/scorm2004/ims/ss/sequencing/Sequencing.java | Changes the ADL objectives field/accessors to use the ADL container model. |
| src/main/java/dev/jcputney/elearning/parser/input/scorm2004/adl/sequencing/ADLObjectives.java | Adds the ADL objectives container class. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Fail closed when XML hardening features cannot be applied, matching ScormVersionDetector - Guard minNormalizedMeasure parsing against NumberFormatException in the DOM restoration pass - Return an empty list from Scorm2004Metadata.getAdlObjectives when the ADL container has a null objective list - Add regression tests for a non-numeric minNormalizedMeasure and an empty adlseq:objectives element
jcputney
enabled auto-merge
July 22, 2026 16:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jackson XML binding collapsed same-local-name
objectiveselements by local name, so anadlseq:objectivesblock overwrote theimsss:objectivescontainer when both were present: the IMSprimaryObjective(with its mapInfo targets) was silently lost and ADL maps bound through the IMS mapping type, dropping the score/progress flags. Broke SCORM 2004 packages declaring both containers for the same objectiveID — found via ADL CTS package OB-10a failing in a downstream LMS (the write map to the IMS global never existed, so cross-activity objective state never propagated).Changes
ADLObjectives/ADLObjectivecontainer modelsadlseq:objectivesfaithfully with the full adlseq map-flag set (raw/min/max score, completion, progress measure; schema defaults reads true, writes false peradlseq_v1p3.xsd).Scorm2004Parserrestores the IMS and ADL containers namespace-aware after the Jackson parse.Sequencing.getAdlObjectives()now returns the ADL container; the IMSprimaryObjectivesurvives with its own mapInfo.Scorm2004Manifest/Scorm2004Metadata) is additive across both containers;SequencingUsageDetectorupdated.Tests: same-ID dual declarations keep separate containers; every ADL flag round-trips from XML; omitted flags return schema defaults. Full suite: 1238/1238 green.
Downstream validation: with this fix (plus engine-side changes), ADL CTS OB-10a's full cross-activity objective walk passes end-to-end in the consuming LMS.