What does Painless Learning Web do?
Turn learning materials into one web page per course, allowing users to learn sequentially, learn correctly, and verify mastery with exercises. A course is a long-term project: you can add new materials weekly; during exam preparation, open the relevant sections within the same page. When users have no materials, first help them plan a learning route, find authoritative resources, then build the web page.
Zero: Environment Setup (Adapting to Different AI Agents)
This skill was originally written for Claude. Below explains how to implement it in other agents like Codex, WorkBuddy, etc. Follow the rules in the main text, but handle environmental differences here.
- Read files: Use the file tools or scripts available to you to read the user-provided folder (PDF, PPT, DOCX, images). If OCR is not possible, tell the user which pages could not be read.
- Internet access: Use search tools for planning from scratch and fact-checking; if unavailable, note this and ask the user to provide materials.
- Questions: Ask all questions at once when needed; use multi-choice question tools if available.
- Where to put the web page: Default to
_LearningWeb/inside the course folder (if no course folder exists, create<CourseName>_LearningWeb/in the current working directory):index.htmlis the full page (single file, embedded data, open directly in browser);data/course.jsonis the canonical data file;img/stores source screenshots. If you can host the page, publish a hosted version separately, but the local folder always remains the master. - No AI invocation within the page: Where the main text says "Ask Claude to organize in the page / use sample, db, assets capabilities", instead save to localStorage and provide a "Copy all (for AI use)" button; the user sends the content back to you for organization.
- Validation: When Python is available, run
python3 scripts/validate_course.py <path>/data/course.json, fixing until no errors remain; when a browser or headless browser is available, openindex.htmlto check rendering and interaction; for checks you cannot perform, inform the user.
One: Determine the Specification First
Determine the category based on the user's words and materials. If uncertain, ask with a single round of up to 3 questions. If the user is absent, choose the most reasonable category and explain why in the delivery.
| Type | Typical Scenario | Goal | Focus |
|---|---|---|---|
| Self-Study Understanding | Only textbooks, online course transcripts, articles; not for exams | Understand, and understand correctly | Explain clearly and correctly; verify with comprehension questions; no exam analysis, no timing |
| Lightweight Introduction | Just want a quick grasp of a concept or small topic; expected total study time < 3 hours | Build correct understanding quickly | No route, no confirmation; decide the route yourself and generate the page directly (see section Four-Three) |
| Self-Study · From Scratch | Only know which area to learn, no materials available | Learn progressively from basics to depth | First research, plan a route, find authoritative courses and textbooks; build the page only after user confirms the route; use a step-by-step, guiding narrative (see section Four-Two) |
| Course Following | Mid-semester, receiving slides and lecture transcripts weekly or bi-weekly | Keep up with the course, understand weekly content | Incremental updates; progress by week; strictly align with course scope |
| Exam Prep · Sprint | Close to exam, little time | Maximize high-frequency points quickly | Calibrate with exam; only learn core and important points; test directly with real exam questions |
| Exam Prep · Thorough | Aiming for high scores, enough time | True mastery | Calibrate with exam; thoroughly explain all knowledge points within the exam closure; first practice simulated questions, save real exams for last |
Information needed (do not ask if inferable from materials):
- Learning purpose: understand, follow course, or prepare for exam
- Available materials
- Current foundation
- Deadline or exam date
- Daily study time available
- Exam format: answer language, whether notes are allowed, calculator restrictions
The same course can start as "Course Following" and later add "Exam Prep". In this case, do not create a new page; open the exam prep section within the existing page (see Section Three).
Two: Course Data File
Each course maintains a course.json, from which the web page is generated. Update by modifying this file, then regenerate the page.
Save in two places to ensure continuity across conversations:
data/course.jsoninside the web page folder- The user's course folder
_LearningWeb/course.json(if writable)
Before updating, read this file. If not found in either location, restore from a published page and inform the user.
{
"course": {"code":"…", "name":"…", "profile":"self|self-plan|course|exam-sprint|exam-deep",
"exam": {"date":"…", "format":"…", "answer_lang":"en|zh", "allowed":"…"}},
"sources": [{"id":"W03L1", "file":"…", "url":"…", "type":"lecture|transcript|textbook|tutorial|lab|assignment|sample_exam|past_exam|exam_info|web", "week":3, "added":"…"}],
"modules": [{"id":"M-sql-basic", "name":"…", "order":5}],
"points": [{
"id":"sql-left-join", // Stable ID, never modify after creation
"no":57, // Display number, reordered each generation
"title":"One-sentence summary",
"module":"M-sql-basic",
"week":5,
"tier":3, // 3 Core / 2 Important / 1 Minor / 0 Not tested (self-study may skip tiering)
"depth":"apply", // recall / explain / apply / transfer
"pre":[{"id":"sql-inner-join","kind":"hard"}, {"id":"null","kind":"soft","why":"IS NULL"}],
"src":[{"source":"W05L1","page":24}, {"source":"W05L1-transcript","time":"32:10"}],
"exam_refs":["Sample Exam 2 Q2A"],
"mastery":"One sentence describing what task proves mastery (must be testable)",
"status":"active|merged|deprecated",
"changed":"Date: what changed",
"note":"Not tested / Supplement / Instructor said…"
}],
"storyline": [{"from":"M-tree", "to":"M-rf", "why":"One sentence: what problem the previous module left, how the next one addresses it"}],
"lessons": [{"id":"L-w05", "track":"learn|review", "title":"…", "points":[…], "steps":[…],
"storyline":[{"role":"Problem|Idea|Method|Result|New Problem", "text":"One or two sentences", "formula":"Optional, simplest form", "steps":[3,4]}]}],
"questions": [ … See section Eight … ],
"changelog": [{"date":"…", "summary":"…", "added":[…], "changed":[…], "conflicts":[…]}],
"course_notes": [{"date":"…", "note":"Preferences or corrections specific to this course (e.g., notation, a module to be taught deeper); all future updates to this course must follow these"}]
}
Rules:
- ID stability: Progress, checkmarks, and incorrect answers are all stored by ID, so user progress is not lost after updates.
- Do not delete knowledge points. Mark unused ones as
deprecated; mark merged ones asmergedand point to the new ID. preonly includes immediate prerequisites.hardmeans must be learned first;softmeans only one concept is used, specify which.
Three: Page Structure – One Page Per Course
Entire course is one page (_LearningWeb/index.html, see "Zero: Environment Setup"). Use top tabs to switch sections, URL hash for navigation (e.g., #map, #lesson/L-w05/3, #q/q-id), enabling cross-section jumps.
Sections and what each profile displays
| Section | Content | Self-Study (incl. from scratch) | Course Following | Exam Prep | |---|---|---|---| | Map | Module topology graph, all knowledge points (checkboxes, prerequisites, sources), progress, "This Update" panel | ✓ (from scratch it's the learning route, with recommended resources) | ✓ | ✓, add "Exam Perspective" | | Lessons | Step-by-step instruction, each step with self-test | ✓ (by chapter or stage) | ✓ (by week) | ✓, add "Review Track" | | Practice | Custom exercises by knowledge point (simulated questions also here, tagged); "Not Mastered" filter is the error notebook | ✓ | ✓ | ✓ | | Exam Info | Exam facts, material priorities, question-by-question table, module weight, not-tested list, instructor notes | — | — | ✓ | | Simulated Questions | Merged into Practice page, filterable by "Simulated" tag; no separate section | — | — | Thorough version | | Real Exams | Sample and past exams (drill manual) | — | — | ✓ (Thorough version keeps them locked until ready) | | Cheat Sheet Draft | Temporarily store content you don't want to memorize; later AI organizes it into a cheat sheet (see Section 6, Item 5) | — | — | ✓ (when notes are allowed) |
Topology graph must be generated
- Every page must include a knowledge point topology graph in the Map section. Regardless of specification, time constraint, or whether confirmation was skipped, the graph must be generated. Include prerequisite knowledge (e.g., when learning "What is an API", draw prerequisites like client, server, HTTP request).
- Only two exceptions: the content is extremely narrow (1–3 knowledge points) or there is truly no dependency between points. In that case, write a sentence in the Map explaining why there is no topology graph.
- When time is tight, you may reduce lesson steps and question count, but not the topology graph.
Navigation layout (Lessons and Practice prioritized)
- Lessons and Practice are the main content; Map, Exam Info, and Learning Path are overviews and should not dominate the top space.
- Top bar (sticky, single line): course code + main section tabs + countdown / progress / terms / progress code mini-buttons. Main tabs: Lessons (default open), Practice (sub-pages: Exercises, Real Exams), Overview (sub-pages: Map, Exam Info, Learning Path), Cheat Sheet (when draft function exists).
- Second line: sub-page tabs for the current main section, plus a single-line Cheat Sheet input (expands on focus).
- The exam info section is retained in all exam prep pages; content is written once and remains unchanged; the learning path changes with progress and user may not follow it, so it's placed in Overview.
Low onboarding cost
- People opening the page should not need to learn how to use it.
- First time each section is opened, display a light-colored explanation at the top (dismissable), one sentence explaining how to use this page, e.g., "Don't check 'Mastered' for uncertain questions; filter 'Not Mastered' to see your error notebook."
- Only one type of question card used site-wide: question → options or input → hint / reveal answer → "Mastered" checkbox in top right corner. Lesson self-tests, exercises, and real exams all use it; learn once, use everywhere.
- Buttons use action verbs ("Reveal answer", "Next step"), not icon-only buttons; minimize filters and toggles on a page; avoid uncommon features.
- For the same action, provide one entry point and one state. Do not allow ambiguous states like "Corrected", "Undo", and "Mastered" to coexist.
All persistent operations must be undoable
- New users will click around to explore. Any operation that saves state must be reversible, leaving no trace after trial.
- Toggle-type ("Mastered", knowledge point checkmark, step "Completed"): click again to cancel; do not make it check-only.
- Answer records: each question has a "Redo" button that clears the answer and feedback, returning to the un-attempted state.
- Operations that lose data (clear, remove, import): after execution, display a bottom toast "Cleared · Undo" for ~8 seconds; clicking "Undo" fully restores. Do not use browser
confirm().- Timer reset, Cheat Sheet item removal, import progress code all use this toast.
- Cheat Sheet removal uses soft delete: move to "Recently Removed" at the bottom; can be restored from there even after the toast expires.
- Before importing a progress code, automatically back up the current progress.
- One-click reset: Inside the progress code popup, include "Clear all my records" for test runs. Before clearing, automatically back up; after clearing, the same popup keeps a "Restore previous record" button.
- Implementation: Before any data-loss write, save a snapshot of the affected state; undo restores that snapshot. The one-click reset backup is stored in a separate localStorage key, overwritten only on the next reset.
Co-existing learning and exam modes
- Only one Map, with a "Learning perspective / Exam perspective" toggle:
- Learning perspective: arranged by week or chapter, showing all knowledge points
- Exam perspective: arranged by exam weight; knowledge points outside the exam closure are grayed out; show exam source labels and learning paths Both perspectives share the same checkmarks.
- Lessons split into two tracks:
- Learning track: weekly lessons during the semester, retained permanently
- Review track: new lessons added during exam prep, arranged by learning path. The review track does not repeat already learned content: previously learned points get a compressed review card linking to the original lesson, plus exam-specific angles (how the question is asked, depth required, common pitfalls). Only points the exam requires but the learning track didn't cover thoroughly are expanded.
- One practice question bank: daily self-tests and exam simulated questions coexist, filterable by tag. The error notebook is shared across modes.
- Exam Info and Real Exams sections appear only during exam prep. The real exam manual belongs to exam prep, not learning mode.
General page features
- Top bar: course name, type, overall progress, and exam countdown (if exam prep).
- Timer: Displayed prominently (top right of each step card, not hidden in sidebar), showing "This step: mm:ss · Course total", updating every second; has "Pause/Continue" and "Reset" buttons (reset only the current step, with "Undo" toast); pause state persists across steps; auto-pauses when switching tabs; time is recorded for the current step or question.
- Mainline popup: Accessible at any time, showing the current lesson's logical thread, highlighting "You are here" (see Section Seven "Logical Thread").
- Terminology popup (bilingual, with one-sentence explanation); math/stats courses add a symbol translator.
- Course material links: Relative paths to original PDFs with
#page=N; transcript timestamps; website URLs for online resources. - Progress code: Export a text string to send to the AI, which knows where the user is weak. Import only adds checkmarks, never removes; backup is made before import, allowing undo.
- All state is stored in localStorage by "course code + stable ID", wrapped in try/catch.
- Unified color scheme with dark mode, consistent throughout the course.
- Mobile-responsive: sidebars stack at top, tables scroll horizontally, respect safe areas.
- Formulas use MathJax SVG output (
tex-svg); notation and typesetting rules follow Section Seven "Typesetting and Notation". - Topology graph: For many knowledge points, precompute layout with Graphviz, render as clickable, zoomable SVG in the page; click a point to highlight all its prerequisites and successors; "View by question" highlights all points needed for a specific question. Module-level small graphs can use Mermaid.
- Source screenshots: Export only referenced slide pages (using pdftoppm or similar CLI tools directly to PNG, no per-page viewing, virtually token-free), store in
img/; clicking the source link opens a popup (PPT files can't show a specific page in browser, so use screenshots). - Page data is embedded directly in
index.html;data/course.jsonis saved separately as the canonical version.
Four: New Course (When Materials Are Available)
1. Read Materials
- Use your available file tools to read the user-provided folder or uploaded files. Read every file: scanned and handwritten pages need OCR; images must be examined page by page.
- Lecture transcripts and online course text are equally important: spoken examples, emphasized points ("this will be on the exam", "many people get this wrong"), and explanations not on slides must be extracted with timestamps.
- First, return a file list to the user, marking unreadable files.
2. Scope and Accuracy
- Course Following and Exam Prep: Scope based on slides and lectures; do not add extra content. Mark necessary background points as "Supplement". Notation matches the slides.
- Self-Study Understanding: Scope based on the user's learning goal; materials are just a starting point. If materials are unclear or wrong, supplement with authoritative explanations, but mark them. Transcripts often have recognition errors and speech slips; correct based on context and verify key facts and formulas against reliable sources. Note uncertainties explicitly.
3. Decompose Knowledge Points
- Granularity should be fine: each point covers only one thing (a definition, property, method, question type, or trap). If a single point contains two separately testable items, split further.
- For learning types, depth follows the material: if the material derives something, depth is
explain; if it provides an example, depth isapply. For self-study, follow the user's goal.
4. Build Topology
- Form a directed acyclic graph. A cycle indicates incorrect decomposition; re-decompose.
- Course Following: order by week, within a week by dependencies. Self-Study: entirely dependency-based.
- Module graph: Use Mermaid flowchart; solid lines for required prerequisites, dashed lines for soft dependencies (explain which concept); color-code importance; node labels include number ranges. Below the graph, summarize the main lines in one paragraph.
5. Confirm Topology Before Generating Page
- The core content for user confirmation is the knowledge point topology graph, not a module list. Approach: decompose all knowledge points individually, scatter them; starting from the knowledge points needed for exams (or learning goals), find their prerequisites, prerequisites of prerequisites, etc., forming the topology. Cross-module connections are required (e.g., a question in Module 8 uses tools from Module 7 or a prerequisite course), making the page's narrative smoother than school materials.
- Knowledge points are numbered by "immediate prerequisite" order: each prerequisite appears just before its first use; do not stack all prerequisites at the beginning.
- You may first publish a version containing only Map, Exam Info, and Learning Path for the user to confirm interactively on the graph; then generate Lessons and Practice in batches after confirmation.
- Prerequisite knowledge can be made into separate courses by source (e.g., "Matrices and Rank (Quick Prerequisite Recap)"); each course's step 0 lists "You should already know these (from other courses)" with links.
- Only ask for confirmation when the user can judge: users with slides, exam scope, or relevant background can confirm. Do not ask beginners, as they cannot judge correctness; instead, the AI cross-checks against slides or authoritative sources and directly inserts into the page.
- When confirmation is skipped (whether because the user is a beginner or time is short), the topology graph is still generated and placed in the Map section.
Four-Two: Without Materials – Plan a Route First
1. Clarify Goals
- What level of mastery? What is it for (reading papers, projects, interviews, interest)?
- What related basics do they have?
- Weekly time available?
Infer from conversation; do not ask if possible.
2. Research
- If Internet search is available, find recognized resources in the field: university open courses (course pages, slides, videos), classic textbooks, official documentation, surveys. Prioritize original, authoritative sources; record links and specific chapters or lectures.
- Compare 2–3 authoritative source syllabi, summarize the main blocks, which are basic, which are advanced, and their dependency relationships.
3. Present Learning Route for User Confirmation
- Field overview: What are the main blocks? For the user's goal, which blocks are mandatory, which can be deferred?
- Prerequisite check: What basics are needed? If unsure, give 3–5 diagnostic mini-questions; adjust the starting point based on results.
- Main resource: Recommend one course or book as primary, others as supplementary, with rationale (authority, difficulty suitability, free availability).
- Staged route: Each stage includes:
- Learning objective (testable)
- Core concepts
- Recommended resources (specific chapters or lectures, with links)
- Estimated time
- Stage verification method Explain the progression between stages: "What problem did the previous stage solve? What new problem does this stage address?"
- The user confirms goals, time, and main resource. The knowledge point topology graph does not require user confirmation: the AI cross-checks against authoritative sources and directly inserts into the page.
4. Build the Page After Route Confirmation
- The learning route becomes the Map. Researched materials are recorded as sources (type web or textbook), each knowledge point has a source.
- AI writes the instruction based on these sources; key facts and formulas are verified; original links are provided for deeper reading.
- When the user later obtains textbooks, lecture transcripts, or handouts, process them as incremental updates (Section 5): add sources and depth, do not rebuild from scratch.
5. Guiding Narrative
- Each step starts from a problem, phenomenon, or need. First, let the user think; they can choose a guess, then reveal the answer and reasoning.
- Progress in small steps, using already-learned material to introduce new concepts.
- For difficult parts, start with the simplest case, then generalize.
- At the end of each stage, review: what you can now do, what problems remain unsolved, and how the next stage will solve them.
Four-Three: Lightweight Introduction (Total Time < 3 Hours)
1. How to Determine
Apply if both conditions are met:
- The user asks about a concept or small topic, e.g., "What is X?", "X intro", "Want to learn about X"
- Estimated total study time < 3 hours, roughly ≤ 15 knowledge points, 1–3 lessons
If the scope exceeds this, switch to "Self-Study Understanding" or "From Scratch".
2. Process
- No questions, unless the topic is unclear.
- No route waiting for confirmation: Decide knowledge points and order yourself, generate the page directly.
- If the user's foundation is unknown, assume an "intelligent layperson" starting point. Prerequisite knowledge is not required to be learned beforehand; instead, include a "Prerequisite Cheat Sheet" in step 0: explain each prerequisite in one sentence.
- If Internet access is available, verify key facts and formulas via search and provide links in sources.
3. Simplified Page
- Keep only three sections:
- Lessons: 1–3 lessons, 5–10 steps each
- Practice: 1–2 questions per knowledge point
- Simplified Map: small topology graph, including prerequisites (e.g., client, server, HTTP for learning API), plus one main line of progress
- Omit Exam Info, Simulated Questions, Real Exams, Timer, Review Queue, and Progress Code.
- Still include:
- Explain intuition before definition; one example throughout
- Plain-language box (for math/stats)
- Logical thread at the end of each lesson
- Mastery criteria and self-tests for each knowledge point; targeted explanations when wrong
- The last page says "What to learn next." If the user wants to go deeper, the page can be upgraded to "Self-Study" or "From Scratch" mode, expanding in place. Therefore,
course.jsonis saved normally.
Five: Incremental Updates (Weekly or Bi-weekly)
- Read
course.jsonand new materials. - Extract knowledge points from new materials, compare each with existing points, and classify into one of the following:
| Case | Action |
|---|---|
| Completely new content, all prerequisites exist | Add |
| Extension or deepening of an existing point | Create a new point with the old point as a hard prerequisite; do not stuff into the old point |
| Same as an existing point | Do not create new point. Add source to old point; update depth if deepened |
| Instructor corrects previous content | Modify old point, write in changed, add "Corrected" flag in the page |
| Late-added prerequisite (new content is actually base for an old point) | Add this prerequisite, add prerequisite edge to old point. Do not reorder published lessons; add a "Look Back" card in a new lesson, linking to the old point, explaining how to understand it now |
| Contradiction between new and old (notation or wording) | Record both, mark as "Pending Confirmation"; ask the user which to use at delivery |
| Cycle introduced after adding edges | Split the overly coarse knowledge point; mark old ID as merged, point to new split points |
| New topic | Create a new module. If new content fits an existing module, extend it; do not rename modules arbitrarily |
- Validation: all
preIDs exist and are active; no cycles in the graph; no knowledge point appears before its hard prerequisite (except for late-added prerequisites, but must have a "Look Back" card). - Old points with content changes are marked "Updated, suggest review"; retain user's original checkmark.
- Write to
changelog, display in the "This Update" panel on the Map: count of new, corrected, late-added prerequisites, and pending confirmations. - Regenerate the page, write back to the same page folder (if hosted, publish to the same URL); user's paths or links remain unchanged.
Six: Exam Preparation
1. Use the Exam as Anchor, Reverse-Engineer Knowledge Points
- Prioritize materials: Primary is sample exams or past exams with official answers; Reference is other past exams and assignments; Main track remains slides; tutorials and labs as supplements.
- Deconstruct questions: break each question into sub-questions, then into the skills tested; list "knowledge points required to answer this sub-question."
- Reverse-engineer closure: Starting from these knowledge points, follow hard prerequisites backward to get all points needed for the exam. Points outside this closure are demoted to minor or not tested.
- Depth calibration: Determine depth based on how the question asks. For the same point tested by multiple questions, take the deepest level:
- Judgement/multiple choice →
recall - Explain, compare, why →
explain - Calculate, write code, draw, follow steps →
apply - Novel scenario, synthesis, design →
transfer
- Judgement/multiple choice →
- Gap check:
- Content needed for exam but not in slides → write commonsense explanation, mark "Not in slides"
- Content in slides but explicitly excluded by exam instructions → mark as not tested
- Content tested in past exams but not in this year's slides → list separately
- Write results into the Exam Info section: question-by-question table (question → knowledge points → score), module weight table, not-tested list, instructor remarks (with dates), patterns from past exams, general answer templates.
- Learning path: Segment by user's available time. Lessons are always organized by course module (one module per lesson, prerequisites grouped by source), so they can be reused; the learning path only references lesson steps ("which steps of which lessons to study today"), does not split lessons by day. Each segment lists the numbers to study, why they are placed here, and what questions to use for verification. Sprint version includes a backup plan listing "can be dropped first"; thorough version schedules by day, with new content and review items due.
2. Sprint vs. Thorough Version
| Sprint Version | Thorough Version | |
|---|---|---|
| Scope | Core and important points | All points within exam closure |
| Instruction | Teach enough to answer questions | Teach to calibrated depth; transfer level requires variations |
| Practice | Test directly with real exams | First practice simulated questions, then real exams when proficient |
| Real Exams | Use as you learn | Locked: unlock corresponding real exam questions only when all simulated questions of a type are mastered; final full-length timed simulation |
When time is short, cut in this order: first remove instruction for minor knowledge points, then reduce question count, only then compress lesson steps. Do not cut topology graph and exam info.
3. Simulated Questions (Required for Thorough Version)
- Write 3–6 simulated questions per exam question type: test the same skills, change context and data, difficulty at least as high as real questions. Each marks the corresponding real exam type (e.g., "Sample Exam 2 Q2D type") and the tested skills.
- Order of creation: single-skill questions first, then combined-skill questions, finally questions of the same complexity as real exams.
- After each module, immediately follow with simulated questions for that module.
- Place simulated questions on the Practice page, tagged as "Simulated"; do not create a separate section.
4. Real Exam Manual
- Modules sorted by exam weight; Module 0 is exam intelligence and answer strategies; each module starts with a "Must Memorize" box.
- Each question includes: level tags (official answer / derived answer, note if non-official), source and score, original text, Chinese translation (if exam is in English), approach, default-collapsed answer, "Mastered" checkbox. Each sub-question uses the site-wide question card.
- When the exam is in English, the answer first gives a section that can be copied directly, then explains in Chinese why this answer is correct.
- A full-exam timer (preset to exam duration, can be paused and reset) and a "Show/Hide all answers" toggle. Do not implement rarely used features like per-question timer, text highlighting, or error category classification.
5. Cheat Sheet Draft (Add when exam allows notes)
- A single-line input box at the top of the page: paste text and press Enter to save; LaTeX auto-renders; paste images directly (stored as data URLs). Paste anywhere on the Cheat Sheet page also saves.
- Each entry records the context at the time of pasting (which lesson, which step, which knowledge point). Entries are stored in localStorage.
- A "Copy all (for AI use)" button: user sends the content with context to the AI; the AI organizes the scattered content into readable entries (title + body, Chinese explanation, keep English terms, formulas in LaTeX), then writes back to the page data; original text is retained and switchable.
- Click cards to select (multi-select), right-click menu "Remove selected", with an in-page confirmation dialog (do not use
confirm()); on mobile, use toolbar buttons. Removal is soft delete: can be undone via toast or restored from "Recently Removed". - Purpose: When creating a note sheet, the draft page's content becomes a small section of "least solid parts" on the cheat sheet; the rest is auto-generated by AI from the course.
Seven: Lesson Writing
Common to All Types
- Each lesson starts with Step 0: what problem this lesson solves; after this lesson, you should be able to… (a bullet list of testable items).
- First explain intuition, then write definition, then give an example. Use one example throughout the lesson; subsequent steps repeatedly use it.
- Keep sentences short, speak plainly, avoid fluff. Chinese explanation, retain English original terms; when the exam is in English, label English keywords in each step.
- Display only one step at a time; bottom has Previous/Next buttons. Card top shows: Step N · Est. minutes · Knowledge point ID · English term.
- Left sidebar has three levels, clearly distinguishable and not cramped:
- Unit (Prerequisite, Module X…): collapsible title bar with background color and progress, default expand only the current unit; record only manual expand/collapse (do not treat initial toggle as user action)
- Lesson: one row per lesson, module color dot on left, progress badge on right; current lesson outlined and highlighted; ungenerated lessons grayed out
- Steps: expand only within the current lesson, arranged in a vertical timeline; each step has a numbered dot (✓ when complete), smaller font, time on the right; "Lesson Thread" button above the step list
- Within the card, use these content blocks as needed:
- Core formula or definition box
- Plain-language box
- Example box
- Exam point box: mark source, expand row by row with "Next"
- Common pitfall box
- Answer writing box
- FYI (small text)
- Look Back card (for incremental updates)
- Self-test
- Even in exam prep, teach the subject comprehensively: sample exams represent question types and typical problems, not that things outside the closure won't be tested. Understanding is the goal, exams are just assessment.
- For each step, the "Why learn this now" section should state the academic motivation (what problem the previous step left, how this step solves it), not "because it's tested"; exam source references are listed separately at the end of the step
- Knowledge points outside the closure are still included in the lesson and taught clearly, just marked as minor
Fixed Structure for Each Step
Write each step in the following order. Skip as needed, but do not reorder:
- Why learn this now: One sentence stating the academic motivation (what problem the previous step left, how this step solves it)
- Intuition: 1–3 sentences, or use specific numbers from the running example to pose a question
- Definition / Core Formula Box: Formula centered on its own line
- Plain Language: Directly below the formula, explain each symbol (what it is, type: number/vector/matrix, random or fixed), then one sentence on "when this quantity increases, how does the result change?"
- Example Box: Use the running example, substitute numbers and calculate step by step
- Common Pitfall Box (only if applicable)
- Self-Test Questions: 1–2 questions that precisely test the mastery criteria of this step
- Exam Source Reference: Final small-line text listing real exam sub-questions that test this step
Fixed Formula and Typesetting Rules (following MAST90138 review lesson)
- Inline or display: Short symbols go inline (
$\hat\beta_1$); definitions, core formulas, and key conclusions are centered on their own lines. - Derivation chains: Use
aligned, align at equals sign, each line right side\quad\text{(reason)}with a short reason; very long inequalities or formulas also usealigned, breaking into lines, not bursting the card. - Numerical calculation fixed three segments: Write formula → substitute numbers → write result, keeping 3–4 significant figures; all numerical values verified by code.
- Use
\text{}only for short words in formulas, not for Chinese long sentences. - Use proper LaTeX notation, consistent with slides: vectors and matrices in bold (
\mathbf{X},\boldsymbol\beta); calligraphic for Fisher information (\mathcal I), model (\mathcal M), normal (\mathcal N); operators and distribution names in upright (\operatorname{Var},\mathrm{SS}_{\text{res}},\mathrm{Bin}). Do not compose formulas with Unicode (XᵀX, β̂, F(2,4), etc.); this applies to knowledge point titles, mastery criteria, options, hints, and exam translations. Only SVG topology graph node labels may use plain text. - Define a set of macros in MathJax config (e.g.,
\X,\bb,\SSres,\FI), shared site-wide for consistent notation; load theboldsymbolpackage when using\boldsymbol. Always use raw strings (r"…") for Python strings containing LaTeX. - Do not write
<or>directly in formulas: When data is inserted into the page viainnerHTML,$\rk(\X)<p$will be misinterpreted because<pis treated as an HTML tag start, consuming the rest of the string and exposing broken code like$\rk(\X). When generating the page, process all data strings uniformly: replace<with\lt{}and>with\gt{}before injecting into HTML. Or usetextContentinstead ofinnerHTMLfor content containing LaTeX; or use\ltand\gtdirectly in the data. This is a must-do step;
…
[truncated for additional content – the remainder preserves original structure]