What It Does
- Generate customizable word problems for addition, subtraction, multiplication, and division
- Support single-digit and multi-digit operations with difficulty scaling
- Create mixed operation worksheets (addition/subtraction combinations)
- Handle special cases like regrouping, carrying, and remainders
- Automatically generate answer keys with proper formatting
- Provide multiple template variations per operation type
- Customize problem quantity and difficulty for different grade levels
- Optimize worksheets for print on standard letter-sized paper
Why I Built This
Math word problems are essential for helping students connect abstract mathematical concepts to real-world scenarios. However, creating quality word problems is time-consuming for teachers. I recognized the opportunity to build a system that could generate contextually rich, mathematically accurate problems at scale.
What started as a simple addition generator evolved into a comprehensive system supporting 17+ variations across all basic operations. The goal was to give teachers a tool powerful enough to create differentiated instruction materials—easy problems for struggling students, challenging ones for advanced learners, and everything in between—all with a few clicks.
How It Works
The Word Problem Generator is built with React and uses a template-based system for creating problem variations. Each generator variation uses predefined problem templates with variable slots that get filled with randomly generated values constrained by difficulty settings and mathematical rules.
The system validates that generated problems are mathematically sound (no negative results in subtraction for beginners, appropriate dividend/divisor relationships for division, etc.) and formats answers consistently. The template system allows for rich contextual variety—problems about shopping, sports, cooking, and other relatable scenarios—while maintaining mathematical rigor.
A major architectural milestone was implementing the strategy pattern, which dramatically reduced the time needed to create new generator variations. What previously took weeks of development could be accomplished in days, allowing rapid expansion of the system to cover more operation types and difficulty levels.
Impact
By the numbers:
- 17+ generator variations published across addition, subtraction, multiplication, division, and mixed operations
- 11 variations published in a single month (October 2023)
- 8 variations created in July 2022 (up from 2-3 per month previously)
- 60% reduction in development time through architectural improvements
- Variation creation time reduced to ~15 hours per set
What changed:
- Enabled rapid creation of differentiated instruction materials for all grade levels
- Eliminated manual word problem writing for common operation types
- Provided consistent mathematical accuracy across thousands of generated problems
- Supported educators worldwide with accessible, free educational tools
- Established scalable architecture enabling future expansion
Challenges & Solutions
Architectural Complexity: As the number of generator types grew, code duplication became a serious problem. Each new variation required duplicating core logic with minor tweaks. I solved this by implementing the strategy pattern, which separated the problem generation logic from the rendering system. This allowed generator variations to share common code while customizing only what made them unique.
Mathematical Validation: Different operation types have different constraints. Subtraction shouldn't produce negative numbers for young learners. Division needs appropriate divisor selection to avoid impossible problems. I built a flexible validation system that could enforce operation-specific rules while maintaining code reusability.
Template Design: Creating word problems that feel natural and contextually appropriate while maintaining mathematical flexibility was challenging. I developed a template system that used realistic scenarios with variable slots, ensuring problems were both educationally sound and engaging for students.
Testing at Scale: With 17+ variations, manual testing became impractical. I refactored the test suite into a batch-type execution system, allowing comprehensive testing across all variations with minimal manual effort. This was essential for maintaining quality as the system scaled.
What I Learned
This project taught me the value of stepping back to improve architecture before pushing forward with more features. The strategy pattern refactor felt like it was slowing down progress initially, but it was one of the best investments I made. That week of refactoring saved months of development time across the remaining variations.
I also learned about the importance of designing for extensibility from the start. Early generator versions were tightly coupled, making each new variation a full reimplementation. By separating concerns—problem generation from rendering, validation from template logic—I created a system that could grow efficiently.
Technical skills developed:
- Advanced React architecture with complex state management
- Design pattern implementation (strategy pattern, factory pattern)
- Separation of concerns in component design
- Template-based content generation systems
- Mathematical validation and constraint logic
- Batch testing architecture for scaled systems
- Code refactoring for maintainability and extensibility
Project evolution:
- Phase 1 (Oct-Dec 2021): Initial development of addition and subtraction generators with basic templates
- Phase 2 (Jan-May 2022): Expansion to multiplication, division, and multi-digit variations
- Phase 3 (Jun-Jul 2022): Major architectural refactor implementing strategy pattern—development velocity increased 300%
- Phase 4 (Jul-Oct 2023): Rapid expansion phase creating 17+ variations and publishing at scale
- Phase 5 (Sep 2023): Factory pattern refactor separating generation from rendering, enabling future multi-render support
Technical Highlights
Strategy Pattern Implementation: The biggest technical milestone was refactoring the generator core to use the strategy pattern. This allowed pluggable problem-generation logic with minimal code changes, reducing new variation development time by approximately 60%.
Factory Pattern Separation: In September 2023, I refactored the Word Problem Factory to separate from the rendering model. This architectural improvement improved memory efficiency through better enumeration usage and positioned the system for future multi-render capabilities.
Batch Testing System: Created a comprehensive testing framework that could execute tests across all generator variations automatically, catching edge cases and ensuring mathematical accuracy at scale.
Dependency Injection Improvements: Refactored the dependency injection system to allow generator variations to share code more effectively while maintaining flexibility for customization.
Generator Variations Published
Addition Generators:
- Single-digit addition
- Multi-digit addition with carrying
- Multi-digit addition without carrying
Subtraction Generators:
- Single-digit subtraction
- Multi-digit subtraction with regrouping
- Multi-digit subtraction without regrouping
Multiplication Generators:
- Single-digit multiplication (3 variations)
- Multi-digit multiplication
Division Generators:
- Division with and without remainders (3 variations)
Mixed Operations:
- Combined addition/subtraction (5 variations)
Links
- Live Generators: allkidsnetwork.com/worksheets/math
- Company: All Kids Network
- Role: Solo Developer & Content Engineer (Dec 2020 - Oct 2024)
- Timeline: October 2021 - October 2023 (initial development through major publishing push)
- Technologies: React, JavaScript/TypeScript, Template Systems, Design Patterns