How judgepeach/math-question-bank works
MathBank is a local-first mathematics question bank and exam-preparation workspace. Teachers manage and classify questions, optionally use AI to select or explain them, assemble a paper, preview its A4 layout, and export PDF or editable Word. A second major workflow imports existing exams through format-specific parsing, image verification, and human review before questions enter the bank. The README documents these capabilities; the excerpts show selected storage, task, and PDF-figure internals, so links for unsampled subsystems rely on README statements rather than inspected call sites.
Main entry points: main.py Question APIs · paper_api.py Paper APIs · database.py Question database · workspace.js Web workbench
Components 25
Teacher workspace
- Web workbench
static/js/workspace.js - Question editor
static/js/editor.js - Single-question OCR
static/js/ocr.js
Question bank
- Question APIs
main.py - Question database
mathbank/database.py - Curriculum catalog
mathbank/curriculums.py - Knowledge points
mathbank/knowledge_points.py - Search and duplicates
mathbank/question_duplicates.py - Read-only agent API
mathbank/agent_reads.py
Document ingestion
- Import workspace
static/js/document-import-session.js - Document projects
mathbank/document_projects.py - Document parsing
mathbank/document_project_pipeline.py - PDF figure pipeline
mathbank/pdf_figure_pipeline.py - Figure verification
mathbank/pdf_figure_review.py - Import review
mathbank/import_review.py
Paper production
- Paper workbench
static/js/paper.js - Paper APIs
mathbank/paper_api.py - A4 layout
mathbank/paper_layout.py - Word export
mathbank/word_export_helper.py
Local runtime
- Backup and restore
mathbank/backup.py - Tiered asset storage
mathbank/tiered_storage.py - Background tasks
mathbank/task_manager.py - AI providers
mathbank/ai_providers.py
Other components
- Teacher
- AI service
Connections 27
- Teacher → Web workbench: uses
README.md - Web workbench → Question editor: opens
README.md - Question editor → Question APIs: saves questions
README.md - Single-question OCR → Question APIs: submits reviewed result
README.md - Question APIs → Question database: reads and writes
main.py - Question APIs → Curriculum catalog: classifies by
main.py - Question APIs → Knowledge points: applies tags
main.py - Web workbench → Search and duplicates: searches bank
README.md - Teacher → Read-only agent API: requests read access
README.md - Read-only agent API → Question database: reads questions
mathbank/agent_reads.py - Teacher → Import workspace: uploads exam
README.md - Import workspace → Document projects: creates import project
- Document projects → Document parsing: runs parsing
mathbank/document_project_pipeline.py - Document parsing → PDF figure pipeline: assembles figures
mathbank/pdf_figure_pipeline.py - PDF figure pipeline → Figure verification: requests verification
mathbank/pdf_figure_pipeline.py - Import workspace → Import review: reviews parsed questions
README.md - Import review → Question APIs: imports accepted questions
README.md - Teacher → Paper workbench: assembles paper
README.md - Paper workbench → Paper APIs: configures paper
README.md - Paper APIs → Question database: selects questions
README.md - Paper APIs → A4 layout: previews layout
README.md - Paper APIs → Word export: exports Word
README.md - Paper APIs → AI providers: requests AI selection
README.md - AI providers → AI service: sends model request
README.md - Document projects → Background tasks: tracks processing
mathbank/document_project_pipeline.py - Backup and restore → Question database: backs up data
mathbank/backup.py - Backup and restore → Tiered asset storage: handles assets
mathbank/backup.py