Skip to content

Assembly: move WeBWorK processing out of the webwork pass#2806

Merged
rbeezer merged 5 commits intoPreTeXtBook:masterfrom
rbeezer:webwork-assembly-id
Mar 26, 2026
Merged

Assembly: move WeBWorK processing out of the webwork pass#2806
rbeezer merged 5 commits intoPreTeXtBook:masterfrom
rbeezer:webwork-assembly-id

Conversation

@rbeezer
Copy link
Copy Markdown
Collaborator

@rbeezer rbeezer commented Mar 26, 2026

Summary

This is a pure refactoring — no change in behavior for authors or publishers. Moving WeBWorK representations substitution to the representations pass (where it belongs in the pipeline) will make @assembly-id available on the parent exercise when WeBWorK content is substituted, enabling future work that needs it there.

  • Strip webwork pass to only stamp @ww-id: removes everything except the @ww-id stamping; updates the section header and block comments to reflect the reduced scope.
  • Move @copy resolution to assembly pass: a new webwork[@copy] template in mode="assembly" resolves copies after @ww-id is available; the @ww-id of the source element is preserved (not overwritten by the target's).
  • Unify exercise tagging for WeBWorK to single value: the exercise-tagging pass previously used webwork-reps as the @exercise-interactive value after substitution; simplified to always use webwork since the distinction is no longer meaningful at that point.
  • Move representations substitution to representations pass: the lookup of webwork-reps from the server file now happens in mode="representations", where @assembly-id is available on the parent exercise. An RTF is built with webwork-reps substituted in document order so sibling relationships are preserved.
  • Update Runestone: two references to the old webwork-reps value of @exercise-interactive updated to webwork.

Testing

Built the examples/webwork/sample-chapter project against both master and this branch using pretext/pretext -vv in all three relevant intermediate formats (assembly-static, assembly-dynamic, assembly-pg). Diffs between the before and after outputs showed exactly three expected differences, all benign: @assembly-id is absent from the interior of substituted webwork-reps content (that content enters the pipeline after the assembly-label pass, so this is correct); the @exercise-interactive value changes from webwork-reps to webwork (the intent of the unification commit); and @exercise-interactive="webwork-task" is absent on tasks from the representations file (no template reads this value). No functional regressions.

Authored by Claude Sonnet 4.6 as assistant to @rbeezer

rbeezer and others added 5 commits March 26, 2026 15:17
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…s pass

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…work

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rbeezer rbeezer merged commit bc566d6 into PreTeXtBook:master Mar 26, 2026
@rbeezer rbeezer deleted the webwork-assembly-id branch March 26, 2026 22:28
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.

1 participant