Skip to content

Preserve imsss and adlseq objectives as separate containers#552

Merged
jcputney merged 3 commits into
mainfrom
fix/adlseq-objectives-container
Jul 22, 2026
Merged

Preserve imsss and adlseq objectives as separate containers#552
jcputney merged 3 commits into
mainfrom
fix/adlseq-objectives-container

Conversation

@jcputney

Copy link
Copy Markdown
Owner

Jackson XML binding collapsed same-local-name objectives elements by local name, so an adlseq:objectives block overwrote the imsss:objectives container when both were present: the IMS primaryObjective (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

  • 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 per adlseq_v1p3.xsd).
  • Scorm2004Parser restores the IMS and ADL containers namespace-aware after the Jackson parse.
  • Sequencing.getAdlObjectives() now returns the ADL container; the IMS primaryObjective survives with its own mapInfo.
  • Global objective ID collection (Scorm2004Manifest/Scorm2004Metadata) is additive across both containers; SequencingUsageDetector updated.

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.

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.
@github-actions github-actions Bot added area-parsers Parser implementations area-input Input models/ingest area-output Output/metadata type-tests Unit/integration tests labels Jul 22, 2026
@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

Triggered by workflow run.

Benchmark Score Error Unit
🟢 detectModuleType 0.002 ±0.000 ms/op
🟢 parseModule 1.815 ±7.055 ms/op
🟢 detectModuleType 0.000 ±0.000 ms/op
🟢 parseModule 0.107 ±0.338 ms/op
🟢 detectModuleType 0.223 ±0.781 ms/op
🟢 parseModule 0.622 ±2.245 ms/op
🟢 detectModuleType 0.176 ±0.248 ms/op
🟢 parseModule 1.682 ±6.673 ms/op

All benchmarks passed performance thresholds.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 Scorm2004Parser to restore IMS vs ADL sequencing objectives based on XML namespaces.
  • Updates global objective ID collection in both Scorm2004Manifest and Scorm2004Metadata to 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.

Comment thread src/main/java/dev/jcputney/elearning/parser/parsers/Scorm2004Parser.java Outdated
- 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
jcputney enabled auto-merge July 22, 2026 16:42
@jcputney
jcputney merged commit ae1341e into main Jul 22, 2026
12 checks passed
@jcputney
jcputney deleted the fix/adlseq-objectives-container branch July 22, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-input Input models/ingest area-output Output/metadata area-parsers Parser implementations type-tests Unit/integration tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants