Skip to content

feat: 'Answer with coin pictures' option for US currency worksheets - #37

Merged
git-cgallagher merged 1 commit into
mainfrom
feat/coin-picture-answers
Aug 14, 2026
Merged

git-cgallagher merged 1 commit into
mainfrom
feat/coin-picture-answers

Conversation

@git-cgallagher

Copy link
Copy Markdown
Owner

What

Adds Option A + C from the coin-visual discussion: a sidebar checkbox — Answer with coin pictures — visible only when the US currency worksheet type is selected. When on, subtraction ($a − $b =) and make-change problems replace the blank answer line with a write-in row of coin pictures: one of each denomination followed by a × ___ box, so the child expresses the answer as a coin combination.

  • Bills at Grade 3+: the $1/$5 bill art joins the row where subtraction amounts reach $9.99; Grade 2 stays coins-only.
  • Answer key: boxes are filled with the fewest-coins breakdown (greedy — provably optimal for US denominations), plus a key-only note that any combination with the correct total is correct, so valid alternate answers don't get marked wrong. The worksheet itself gets a one-line instruction above the grid.
  • Total line kept (Total: $______) so the child computes the difference first, then represents it in coins.
  • Hidden-state guard: genMixed strips coinAnswers — the checkbox is invisible on mixed review, so a stale checked state can't change mixed output (WYSIWYG).
  • coinSVG/billSVG gain an optional scale param (row renders at 0.55×, viewBox untouched) to keep the default 12-problem sheet compact.
  • Count-the-money and addition problems are unchanged; easy difficulty is unaffected (count-only, matching existing gating).

Docs (same-PR rule)

  • CHANGELOG.md — Unreleased → Added entry. No TYPE_META change, so the wizard needs nothing (it reads TYPE_META live).

Testing

  • node --check generator.js app.js (the CI gate) passes.
  • Generator smoke test, grades 2–5 × easy/medium/hard × 40 problems: every fewest-coins breakdown sums exactly to its answer; bills excluded at G2 / included at G3+; zero coin-row problems on easy, with the flag off, and across 30 seeded mixed-review sheets (10 of which drew currency sections).

Notes (non-blocking)

  • At the default 12 problems the coin rows make blocks taller; small icons (0.55×) keep it close to one page, but very high counts may spill to a second printed page — same as other tall layouts.
  • On easy difficulty the checkbox has no visible effect (easy is count-only by design).

🤖 Generated with Claude Code

Sidebar checkbox (#coinAnswers, shown only for the US currency type)
that turns subtraction and make-change answers into a write-in row of
coin pictures — one of each denomination with a x ___ box — so the
child shows the answer as a coin combination.

- Bills ($1/$5) join the row at Grade 3+ (subtraction reaches $9.99
  there); Grade 2 stays coins-only.
- Answer key fills the boxes with the fewest-coins breakdown (greedy,
  optimal for US denominations) and notes any combination with the
  correct total is correct; worksheet gets a one-line instruction.
- genMixed strips coinAnswers (sets it false) so a checkbox left
  checked while the control is hidden can't change mixed-review output.
- coinSVG/billSVG gain an optional scale param (row uses 0.55) so the
  default 12-problem sheet keeps its footprint.
- Easy difficulty unaffected (count-only, as before).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@git-cgallagher
git-cgallagher merged commit 1cc21b4 into main Aug 14, 2026
4 checks passed
@git-cgallagher
git-cgallagher deleted the feat/coin-picture-answers branch August 14, 2026 16: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.

1 participant