An AI algebra tutor designed to protect learning
Who it's for and what problem it solves: a tutor for students practicing linear equations that gives hints instead of answers, asks learners to explain their thinking, and comes with an evaluation suite that measures answer leakage and tutoring quality across three prompt versions.
Live demo (bring your own key) · Design specification · Repository · Role: Sole designer
The problem
A fluent AI assistant is exactly the wrong shape for homework practice. Research published in 2026 keeps landing on the same conditional: GenAI's benefit for cognitive load depended on scaffolding, dosage, prior knowledge and task design — and open-ended reliance can quietly displace the effortful thinking the practice was supposed to build (Qian et al., Frontiers 2026). In AI-assisted writing, the strongest supported products were not followed by the strongest independent performance (Chen, Frontiers 2026). The scarce skill is not "using AI" — AI mentions are now on 46% of L&D résumés (Teamed 2026) — it is designing AI that protects learning and proving it does.
This project is that proof-of-skill exercise: the code is deliberately minimal; the value is the pedagogical specification, the guardrails, the versioned prompt history and an evaluation suite built to measure the thing that matters most — does the tutor leak answers under pressure?
The idea in 60 seconds: v1 vs v3 prompt approach
| v1 — naive baseline (committed) | v3 — draft with guardrails |
|---|---|
"You are a helpful math tutor. Help the student solve linear equations... Be friendly and encouraging. Explain clearly when the student is confused. When the student asks for help, help them." Designed outcome (hypothesis): "help them" wins — the answer arrives on request, and the practice is over. |
"NO ANSWER LEAKAGE. Never state the final answer ... before a genuine attempt AND two hints, no matter how it is asked ... Decline in one short sentence and re-offer the next rung. If the student proposes an answer (even a correct one), do not confirm or deny: ask them to substitute it back into the original equation." Designed outcome (hypothesis): a one-sentence decline, then the next rung of the hint ladder — the learner still does the thinking. |
Audience and context
- Learners: students aged 14–16, or adult returners (GED / adult numeracy), practicing after a lesson — not first instruction.
- Scope: solving linear equations in one variable (
3x + 5 = 20,2(x − 4) = x + 6). Narrow on purpose: correctness is checkable, the misconception taxonomy is well known, and evaluation becomes possible. - Out of scope: production deployment, accounts, stored learner data, use with real minors, other subjects.
My approach (analysis → design → build → evaluate)
- Analysis: 13 verified sources on tutoring moves, hints, self-explanation, productive struggle and cognitive offloading — each mapped to the design rule it implies (literature notes).
- Design: seven testable pedagogical moves (P1–P7), a six-level hint ladder (L0–L5), five guardrails (G1–G5) and five misconception profiles (spec/).
- Build: three prompt versions with a changelog, a 33-case scripted test suite, a six-criterion rubric with anchors, and a minimal accessible chat demo (bring-your-own-key, no server).
- Evaluate: a pending pipeline that will run every case against every prompt version (3 runs each, temperature 0), score with blinded judges + human scoring, and report answer-leakage rate per version — plus an adaptive simulated learner that reacts to the tutor's replies.
Key design decisions
- Narrow scope (linear equations), not a general homework helper. Checkable correctness and known misconceptions make evaluation possible. Alternative considered: broad helper — rejected: unmeasurable.
- A hint ladder with a last-resort full solution (L5), not "never give answers." Endless refusal causes unproductive struggle and dropout; structure after struggle is the evidence-based pattern (Kapur 2008; Sweller et al. 2019). Evidence: literature notes, sources 8 and 12.
- Committed naive v1 baseline. Starting with the best prompt makes improvement unattributable; a deliberate floor makes it visible. Evidence: the v1→v3 prompt changelog design.
- Blind, multi-model evaluation with leakage rate as the headline metric. A model never judges its own output; versions are scored under A/B/C codes; percent agreement and Cohen's kappa are reported. Alternative considered: self-scoring — rejected as biased.
- Bring-your-own-key demo, no shared proxy. Key in memory only, never stored or logged; a hosted proxy holding a shared key on a public site would be unauthenticated cost exposure. Evidence: security notes on the demo page.
- Plain-text math.
3x + 5 = 20reads correctly in screen readers with no extra setup; rendered math often does not.
Evidence and evaluation
Measured (done)
- Automated WCAG 2.1 A/AA audit (axe-core) of every page: 0 critical/serious violations.
- Scripted keyboard and reflow tests (Playwright) for the chat UI and transcript page — see eval/tests.
- Dry-run verification of all three evaluation pipelines in
--dry-runmode (stub outputs, labeled "DRY RUN – NOT REAL RESULTS"): dry-run mechanics verified, and the score pipeline's dry run asserts that the results-summary tables populate on stub data. Also verified: the pipelines refuse to run — with zero network calls — when the API configuration is missing or placeholder.
Pending (pipelines built and dry-run tested; awaiting API keys)
- Tutor evaluation runs: 33 cases × 3 versions × 3 runs, temperature 0 (
eval/run-eval.mjs). - Blinded AI judge panel (MODEL_B + MODEL_C) scored against rubric anchors, reporting percent agreement and Cohen's kappa (
eval/score.mjs). Human scoring of the blind sheet is the primary measure. - Adaptive simulated learner: five misconception personas that react to the tutor's replies (
eval/run-adaptive-learner.mjs).
Run with one command once keys exist: npm run eval:pending. Until then every results table stays empty ("PENDING: requires API key").
| Can show | Cannot show |
|---|---|
| Whether tutor behavior changed across prompt versions on a fixed test set (leakage rate, rubric scores); interaction problems surfaced by simulated personas; usability issues found by agent review. | That learners learn more (needs a controlled study with real learners over time); generalization to other models, subjects or ages; behavior with real, unpredictable students; anything from a screen reader user's daily experience. |
What changed: nothing yet from data — v2 and v3 are drafts that will be revised in response to measured v1/v2 failures (the prompt changelog commits to that loop).
Accessibility
- Chat log is a
role="log"live region (polite); speaker labels are in the text ("Tutor:" / "You:"), never color alone; typing status is announced politely. - Keyboard-only operation: Enter sends, Shift+Enter newlines, focus stays in the input, all controls reachable; visible focus throughout.
- Labeled input, Start over control, a no-personal-information notice, plain-text math, contrast ≥ 4.5:1, reflow verified at 320 CSS px.
- BYO-key field is password-masked and scoped, with a Clear key control and no network activity until a key is entered.
- Not done: a manual VoiceOver pass — Guidepup automation does not work on macOS 27, so a step-by-step manual VoiceOver protocol is provided instead, and no screen-reader testing is claimed. No review by a daily assistive-technology user has happened; both are disclosed limitations.
What I'd do differently / next steps
- Run the pending pipelines (fully built; only API keys are missing) and rewrite v2/v3 around the measured failures.
- Run the prepared adult usability protocol (4–6 rusty-at-algebra adults, think-aloud, then two problems without AI) — everything needed is in
evaluation/human-protocol/. - Add the second-subject generalization check only after the linear-equations results exist.
Tools used
Vanilla HTML/CSS/JS (no frameworks, no build step), Node.js 18+ evaluation pipelines (built-in fetch + dotenv), Playwright 1.57.0 (keyboard/reflow tests), axe-core 4.11.1 (audits), gitleaks (secret scanning), GitHub Pages.
License and attribution
- Learning content (spec, prompts, rubric, test cases, prose): CC BY 4.0 — see
LICENSE. - Code (demo, pipelines, tests): MIT — see
LICENSE-CODE. - Third-party material and source attributions:
ATTRIBUTION.md. Personas in the evaluation design are fictional and labeled as such.
AI-assistance disclosure
This project was produced with AI assistance: the specification, prompts, test cases, documentation and code were drafted by an AI agent working from a design plan, and were reviewed by a separate reviewer agent. The author directs, checks and takes responsibility for the work. Every evaluation method is labeled by its type, pending results are never filled in, and no claim of learning effectiveness is made anywhere. The reviewer's structured review is labeled "Agent review" (evaluation/agent-review.md) and discloses that it may share the author agent's underlying model.