A revision site for the Hogwarts curriculum shaped like the ones we actually revise from: 71 topic pages, 182 exam questions with 461 marks of point-by-point schemes, flashcards, and a paper generator that stratifies its draw, times itself, and files everything you missed into a redo pile that drains as you fix it.
“Single self-contained offline HTML file; images must be inline SVG or data URIs, with no external requests.”
“Book-canon accuracy is mandatory; where books are silent, say so rather than inventing details. Film-only material must be labelled.”
That pair of rules decides almost every design choice below. No image files means the 19 teaching figures and 16 house/subject emblems are drawn from SVG primitives and checked by a script that parses their own label boxes. No external requests means the whole thing travels as one file whose sha-256 you can compare against the mirror. And “say so” means the app contains sentences that begin “the books do not say” — a revision site that quietly fills gaps teaches the gaps.
Nine subjects are the core timetable; seven more are the electives that exist in the books but never got a textbook. Every row below is counted from the source data, not estimated.
| Subject | Topics | Questions | Marks | Terms | Levels | Figures |
|---|---|---|---|---|---|---|
| Charms | 6 | 17 | 42 | 28 | 5 O.W.L. · 1 N.E.W.T. | 2 |
| Transfiguration | 5 | 14 | 42 | 24 | 3 O.W.L. · 2 N.E.W.T. | 2 |
| Potions | 7 | 20 | 51 | 35 | 3 O.W.L. · 4 N.E.W.T. | 1 |
| Defence Against the Dark Arts | 6 | 17 | 46 | 29 | 6 O.W.L. | 2 |
| Herbology | 5 | 14 | 29 | 24 | 5 O.W.L. | 1 |
| History of Magic | 5 | 14 | 33 | 25 | 5 O.W.L. | 0 |
| Astronomy | 4 | 11 | 27 | 19 | 4 O.W.L. | 1 |
| Care of Magical Creatures | 5 | 14 | 33 | 24 | 5 O.W.L. | 2 |
| Advanced Studies | 6 | 17 | 42 | 29 | 6 N.E.W.T. | 2 |
| Divination | 4 | 8 | 23 | 16 | 2 O.W.L. · 2 N.E.W.T. | 2 |
| Arithmancy | 3 | 6 | 17 | 12 | 2 O.W.L. · 1 N.E.W.T. | 1 |
| Ancient Runes | 4 | 8 | 20 | 16 | 2 O.W.L. · 2 N.E.W.T. | 2 |
| Muggle Studies | 3 | 6 | 16 | 12 | 2 O.W.L. · 1 N.E.W.T. | 0 |
| Flying | 3 | 6 | 16 | 12 | 3 O.W.L. | 1 |
| Alchemy | 3 | 6 | 16 | 12 | 3 N.E.W.T. | 1 |
| Other Subjects | 2 | 4 | 8 | 8 | 2 N.E.W.T. | 0 |
| Total | 71 | 182 | 461 | 325 | 47 O.W.L. · 24 N.E.W.T. | 20 |
“Other Subjects” is deliberately an umbrella rather than a fake syllabus: Ancient Studies, Ghoul Studies, Magical Theory and the wider timetable are named in the books as subjects that exist without any lesson ever being shown, and the page says exactly that.
Charms through Advanced Studies, 293 marks, 164 KB. Enough to prove the page shape: notes, terms, schemes, flashcards, progress. Cut at this stage: anything without a mark scheme — a topic that only described magic could not be revised from.
Divination, Arithmancy, Ancient Runes, Muggle Studies, Flying, Alchemy and the electives umbrella, plus extra topics appended into the original nine by subject id. 325 key terms and roughly 19,700 words. Cut: a proposed “characters” subject, because it would have been a reading list with mark schemes bolted on.
Fifth tab. Tier, length, subject, timed or not; stratified draw; a real deadline rather than a countdown that pauses when you leave; self-marking against the same schemes; last 20 papers filed. Cut: auto-marking free text. There is no honest way to mark “describe the effects of a Dementor” without a human, so the app asks you to be that human and shows the scheme to do it with.
Half-marks and misses enter a pile with a miss count; marking the same question full later removes it. A ranking turns the pile plus unopened topics into a score out of 100 with a reason line and a five-question drill. Deliberately not added: a seven-day plan. The ranking answers “what now”; a timetable is a different build and would have doubled the state surface.
Routes are hash-based so the file opens from the Desktop with no server: #/, #/t/<subject>/<topic>, #/q, #/cards, #/progress, #/paper. An unknown hash falls back to home rather than a blank main — there is an assertion for that, because a broken deep link is the first thing a marker clicks.
| Key | Shape | Why it matters |
|---|---|---|
revised | topic key → timestamp | 10 house points per topic; also the “opened” input to the revise-next ranking |
marks | question id → full / part / none | Drives accuracy, grade and points; a question answered here can also be in the pile |
cards | front|key → known flag | Card identity is the text plus its term, so re-wording a card does not inherit a stale tick |
redo | question id → {ts, n, s} | n is the miss count that ranks the next redo paper; s is the last self-mark |
papers | array, capped at 20 | Result history and the points already awarded; capped so a term of papers cannot fill the store |
paper | live paper object | Questions, answers, self-marks, phase; survives refresh so a timed paper cannot be restarted by reloading |
| Self-mark | Marks awarded | Effect elsewhere |
|---|---|---|
full | all of the question's marks | +5 points; removes the question from the redo pile if it was there |
part | half, rounded only at display | +2 points; enters or re-enters the pile with its miss count bumped |
none | zero | Enters the pile; counts as a full miss when ranking |
| Percentage | Grade | Note |
|---|---|---|
| 90–100 | O · Outstanding | These boundaries are the app's own. They are not from the books, and the Progress page says so above the table — a Hogwarts grade boundary does not exist, so the honest move is to publish ours rather than imply a source. |
| 78–89 | E · Exceeds Expectations | |
| 64–77 | A · Acceptable | |
| 50–63 | P · Poor | |
| 35–49 | D · Dreadful | |
| 0–34 | T · Troll |
Fifteen content modules are imported by
build.py and validated before a byte is written: 3+ terms, 2+ questions per topic, non-empty
schemes, marks ≥ 1, level in {O.W.L., N.E.W.T.}, an emblem for every subject, every fig key
registered, no duplicate topic ids. A warning would have shipped the gap; a non-zero exit does not.
artcheck.py parses each SVG's
label boxes and reports overlaps: figures=19 labels=210 issues=0. It caught a caption crossing a
second caption on the Horcrux plate, which is the kind of defect a screenshot pass reads past because it
looks like two lines of text.
As a moon-backed silhouette it read as a bat with a fin. It became a three-panel field plate — what to look for — because the creature's whole teaching point is that you cannot see it unless you have seen death, and a field-guide layout says that better than a portrait of something invisible.
pickPaper() groups the pool by
subject, shuffles each group and the group order, then takes one from each in turn until the paper is
full. Thirty questions cannot come from two subjects, and no question appears twice in one paper.
Store the time remaining and a
paper waits while you are in another tab. Storing an absolute deadline makes the rule structural — remaining
is always deadline minus now — and the limit comes from the paper itself: marks × 1.5 minutes,
rounded to five, minimum ten.
Half-marks and misses add an entry keyed by question id with a miss count. Marking that question full in a later paper deletes the entry, so the pile is not a to-do list you maintain — it is a consequence of the marking you were doing anyway.
score = min(40, pile marks × 4) + (unopened topics ÷ all topics) × 35 + (nothing marked ? 12 : (1 − accuracy) × 25) pile marks = Σ question marks × (1.0 miss | 0.5 half) × (1 + 0.25 × (miss count − 1))
The three terms are capped at 40, 35 and 25 so no single signal can own the ranking: a subject with a brutal pile but every page read still cannot outrank one you have never opened. Ties break on timetable order, not alphabetically, and the row prints the reasons that produced the score so the number is never a black box.
localStorage under sms.v1 — clearing site
data wipes it, and nothing syncs between devices or survives a private window.| Symptom | Cause | Handling |
|---|---|---|
| Page scrolls sideways at 320 px | A wide figure SVG forced the main column wider than the viewport | .figscroll{overflow:hidden} plus main{min-width:0}; asserted at 320 and 390 px, not by eye |
| Print bleeds off the page | Sheet margins and 12pt body inherited from screen | @page{margin:15mm 14mm}, body 10.5pt, nav/actions/mark buttons hidden in print only |
| Full paper scored 28 of 30 in the harness | The test clicked one mark button and read a different number | Marking is asserted end to end — mark, save, reload, compare the total — in the 42-check paper suite |
| Redo-drain test failed while the app was correct | A five-question drill draws at random, so the pile questions were not guaranteed to be in it | The test seeds the pile with every question in the subject, so any drill must overlap it |
| Starting a paper from Progress left you on Progress | The new paper was created but the route never changed | launchPaper() is now the single entry point and sets the hash itself |
| “Nothing answered yet” shown next to a full pile | Two reason lines written independently | The reason list is built once from the same data that scored the row |
| Caption overlapping a second caption | Hand-placed SVG labels | artcheck.py parses label bounds and fails the build pass at any overlap |
| Reported size did not match the file | Character count vs UTF-8 byte count | Every published size is ls -l bytes; the sha-256 covers the same bytes |
| Check | Result |
|---|---|
| Artifact sha-256 | 60fe044150ed62875155ad4d1e53c4c6b6295043508140eefc53de60b821f098 |
| Artifact size | 396,175 bytes, one file |
| Content count (build output) | subjects=16 topics=71 questions=182 marks=461 figures=20 placements emblems=16 |
Site assertions (verify.py) | 51 passing — routes, search, deep links, marking, flashcards, drawer, 320/390 px overflow, print |
Paper assertions (verify_paper.py) | 42 passing — setup, tier filter, stratified draw, answer persistence, clock expiry, abandon, history, points, pile loop, print, console |
Revise assertions (verify_revise.py) | 20 passing — ranking, reason lines, revised toggle, drill drains the pile, mobile stacking |
| Art checker | figures=19 labels=210 issues=0 |
| External requests | 1 string, and it is the SVG namespace http://www.w3.org/2000/svg. No fetch, no fonts, no CDN. The live copy is served through Cloudflare, whose Web Analytics beacon is injected by the host — that is why the proof is a curl byte comparison rather than a network panel. |
| Mirror | demos/save-my-spells-mirror/index.html, byte-identical to the artifact (same sha-256) |
SKIP_PREFIX in the site's
theme injector, so the deployed file is byte-identical to the source: no skin block, no beacon-stripping
needed for the body, and no floating theme button over the paper clock. The only delta is Cloudflare's own
analytics tag, which is reported with a stripped comparison rather than called a mismatch.The gap is time. The ranking says what to revise; it does not say when. A seven-day plan that drops the top three subjects into real slots with one paper on day seven is the obvious next build — and the state for it (pile, accuracy, opened topics) already exists, so it is a scheduler rather than a new data problem.
Not planned: essay-length marking, cross-device sync, and a “characters” subject. The first needs a model I would not trust to be fair, the second needs an account, and the third is a reading list.