Repository navigation
Conversation
Extracts the formatting of a model Word document as checks into a docx-spec and grades other documents against it (#385). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- validate the structure of hand-edited specs and fail single checks instead of the whole grading - hash long ids so they stay stable when titles share a prefix - read nested tables and pictures in text boxes once - drop fields left unterminated at the end of a paragraph Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
✅ Deploy Preview for teaching-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 18, 2026
Spaces count like tabs to locate paragraphs; the new tabs check reports paragraphs where a student typed spaces instead of a tab. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@inquirer/* requires node >=24.15, the repository pins 24.13. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Format checks get source: style when the original's style gives the expected properties; defaultSource sets it for the whole spec. Numbers typed by hand are found and reported by the numbering check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Part 1 of 3 for #385. It adds the
@hfr/docx-graderpackage with the docx model, the checks and the spec CLI.Behavior
yarn workspace @hfr/docx-grader create-spec <original.docx>reads a model Word document and extracts every formatting that differs from a blank document (Normal.dotm defaults inbaseline/wordDefaults.ts).<original>.docx-spec.yaml.--allskips the list.hint/docsfields teachers add by hand.gradeDocument(spec, docModel)grades another document against the spec. TheDocxGradercomponent in PR 2 will use it in the browser.Check kinds:
Design decisions (agreed with the maintainer before implementing):
Added after the first review round
tabsrequires tabs where the original has them. Spaces still locate the paragraph but fail the check.source: stylewhere the original got those properties from its style, so the student must set them through the style, not directly. A spec-widedefaultSource: style | any(defaultany) applies to checks without their ownsource, which can override it. Overrides survive re-running the CLI.1.1 Text) are found and reported by the numbering check.promptsinstead of@inquirer/*, which needs Node ≥ 24.15 (the repo pins 24.13 and Netlify failed).Follow-ups
DocxGradercomponent and a demo pageValidation
yarn test --run packages/hfr/docx-grader: 39 tests pass. The fixtures are the issue's sample documents with emptied images (184 KB). Each original passes all of its own checks, each RAW file fails the formatting checks, and inline-XML regression tests cover nested tables, text-box pictures, unterminated fields and spec validation.yarn typecheck,yarn format:check(package),yarn build: pass--allon the three samples, plus a re-run that kept the hints. The interactive checkbox was not exercised in CI.design-reviewerskill on the plan and on this branch; all findings fixed.🤖 Generated with Claude Code