This tool generates math quizzes for 1st graders, including solutions, and saves them as PDF files.
- Generate random math problems suitable for 1st graders.
- Automatically create a solution sheet.
- Save quizzes and solutions in PDF format.
- Customize the number and types of problems.
You can generate quizzes with a mix of the following problem types:
addition_subtraction: Basic addition and subtraction problems.comparison: Compare two numbers using<,>, or=.operator_fill: Fill in the correct operator (+or-) to complete the equation.number_fill: Fill in the missing number to complete the equation.
-
Clone the repository:
git clone https://github.com/your-username/math10-quizzer.git cd math10-quizzer -
Create a virtual environment and install dependencies:
python3 -m venv venv source venv/bin/activate pip install -r requirements.txt -
Install Google Chrome: This tool uses
playwrightto convert HTML to PDF, which requires Google Chrome to be installed.
To generate a quiz with 10 random problems and save it as a PDF:
python main.py generateThe output will be saved in the output/YYYY-MM-DD/ directory.
Customization Options:
-
--num-problems: Specify the number of problems.python main.py generate --num-problems 20
-
--types: Choose specific problem types.python main.py generate --types addition_subtraction --types comparison --types operator_fill --types number_fill --num-problems 50
-
--output: Set a custom output path.python main.py generate --output my_quiz.pdf
-
--seed: Use a seed for reproducible quizzes.python main.py generate --seed 42
If you prefer an HTML file, use the generate-html command:
python main.py generate-htmlTo convert an existing HTML quiz to PDF:
python main.py to-pdf your_quiz.htmlTo set up the development environment, install the required dependencies:
pip install -r requirements.txt
playwright install