Isaac Chan · Save My Spells Built Nov 2026 Single file · 396,175 bytes

Save My Spells — 16 subjects, 182 questions, one offline file

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.

Subjects
16 9 core + 7 elective
Topics
71 47 O.W.L. · 24 N.E.W.T.
Questions
182 461 marks, all schemes
Teaching text
19,675 notes + mark schemes
Key terms
325 3 or more in every topic
Art
19 + 16 figures + emblems
The constraint, in his words

“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.

1 · What it actually contains

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.

SubjectTopicsQuestionsMarksTermsLevelsFigures
Charms61742285 O.W.L. · 1 N.E.W.T.2
Transfiguration51442243 O.W.L. · 2 N.E.W.T.2
Potions72051353 O.W.L. · 4 N.E.W.T.1
Defence Against the Dark Arts61746296 O.W.L.2
Herbology51429245 O.W.L.1
History of Magic51433255 O.W.L.0
Astronomy41127194 O.W.L.1
Care of Magical Creatures51433245 O.W.L.2
Advanced Studies61742296 N.E.W.T.2
Divination4823162 O.W.L. · 2 N.E.W.T.2
Arithmancy3617122 O.W.L. · 1 N.E.W.T.1
Ancient Runes4820162 O.W.L. · 2 N.E.W.T.2
Muggle Studies3616122 O.W.L. · 1 N.E.W.T.0
Flying3616123 O.W.L.1
Alchemy3616123 N.E.W.T.1
Other Subjects24882 N.E.W.T.0
Total7118246132547 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.

What each topic page carries

  • Notes in blocks — prose, bullet lists, real comparison tables
  • Key terms, at least three, phrased as the exam would want them
  • Exam tip and common traps, both specific to the spell or creature
  • Two or more questions with the mark scheme shown after you answer

What it is not

  • Not a wiki — no plot summary, no character lists
  • Not themed branding — every note is a teachable fact
  • Not a scan of anything — all prose written for this build
  • Not affiliated with J.K. Rowling, Warner Bros. or Save My Exams

2 · How it got here

V1

Nine subjects, 40 topics, 120 questions

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.

V2

Content expansion to 16 subjects, 71 topics, 461 marks

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.

V3

The paper generator

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.

V4

Redo pile and revise next

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.

3 · The request path

hash change → route() // split on “/”, decide the view → viewTopic / viewQuestions / viewCards / viewProgress / viewPaper → slice DATA and QS // 16 subjects, 182 questions → esc() // every interpolated string → innerHTML into #main   mark / answer → state.marks | .redo | .cards | .papers → save() → localStorage “sms.v1”

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.

4 · Contracts

State — everything the app remembers

KeyShapeWhy it matters
revisedtopic key → timestamp10 house points per topic; also the “opened” input to the revise-next ranking
marksquestion id → full / part / noneDrives accuracy, grade and points; a question answered here can also be in the pile
cardsfront|key → known flagCard identity is the text plus its term, so re-wording a card does not inherit a stale tick
redoquestion id → {ts, n, s}n is the miss count that ranks the next redo paper; s is the last self-mark
papersarray, capped at 20Result history and the points already awarded; capped so a term of papers cannot fill the store
paperlive paper objectQuestions, answers, self-marks, phase; survives refresh so a timed paper cannot be restarted by reloading

Marking, in the only three states that exist

Self-markMarks awardedEffect elsewhere
fullall of the question's marks+5 points; removes the question from the redo pile if it was there
parthalf, rounded only at display+2 points; enters or re-enters the pile with its miss count bumped
nonezeroEnters the pile; counts as a full miss when ranking

Grades — invented, and labelled as invented

PercentageGradeNote
90–100O · OutstandingThese 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–89E · Exceeds Expectations
64–77A · Acceptable
50–63P · Poor
35–49D · Dreadful
0–34T · Troll

5 · The parts that were actually hard

The build refuses to finish

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.

Figures that police themselves

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.

The Thestral, drawn three times

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.

A draw that cannot cluster

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.

A clock that cannot be paused by leaving

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.

A pile that empties itself

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.

Revise next — the whole formula

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.

6 · Honest limitations

Read this before quoting any number off the app.

7 · What went wrong, and what catches it now

SymptomCauseHandling
Page scrolls sideways at 320 pxA 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 pageSheet 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 harnessThe test clicked one mark button and read a different numberMarking 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 correctA five-question drill draws at random, so the pile questions were not guaranteed to be in itThe test seeds the pile with every question in the subject, so any drill must overlap it
Starting a paper from Progress left you on ProgressThe new paper was created but the route never changedlaunchPaper() is now the single entry point and sets the hash itself
“Nothing answered yet” shown next to a full pileTwo reason lines written independentlyThe reason list is built once from the same data that scored the row
Caption overlapping a second captionHand-placed SVG labelsartcheck.py parses label bounds and fails the build pass at any overlap
Reported size did not match the fileCharacter count vs UTF-8 byte countEvery published size is ls -l bytes; the sha-256 covers the same bytes

8 · Evidence

CheckResult
Artifact sha-25660fe044150ed62875155ad4d1e53c4c6b6295043508140eefc53de60b821f098
Artifact size396,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 checkerfigures=19 labels=210 issues=0
External requests1 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.
Mirrordemos/save-my-spells-mirror/index.html, byte-identical to the artifact (same sha-256)
Served copy. The two demo directories are in 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.

9 · What is next

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.

Open the app Full mirror Build spec