How to write standard test question bank files for math topics used in state standard tests
For every topic in the study guide, we need a corresponding question bank file containing 27 realistic standard test questions (15 multiple choice + 6 short answer + 6 graphical). These questions must read and feel like questions students would encounter on an actual state standardized math test (e.g., SBAC, PARCC, STAAR, FSA). The question banks feed into scripts/generate_practice_tests.py, which selects questions randomly to build unique per-state standard tests.
There are two independent question bank sets:
| Bank | Directory | Practice tests output | Books that use it |
|---|---|---|---|
| Bank 1 (existing) | tests_questions_bank/ | practice_tests/ | 3, 5, 7, 10 practice tests |
| Bank 2 (new) | tests_questions_bank_2/ | practice_tests_2/ |
| 6, 9, 12 practice tests |
The two banks are completely independent — different questions, different tests, different books. A student who buys books from both sets gets entirely unique questions.
New question bank files go in tests_questions_bank_2/:
tests_questions_bank_2/
topics/ # Questions for core CCSS topics (mirrors topics/)
topics_additional/ # Questions for additional state-specific topics (mirrors topics_additional/)
topics_modified/ # Questions for modified topics (mirrors topics_modified/)
Each question bank file corresponds one-to-one to a topic file:
| Topic file location | Question bank file location |
|---|---|
topics/ch01-01-unit-rates-with-fractions.tex | tests_questions_bank_2/topics/ch01-01-unit-rates-with-fractions.tex |
topics_additional/ch02-08-personal-financial-literacy.tex | tests_questions_bank_2/topics_additional/ch02-08-personal-financial-literacy.tex |
topics_modified/ch02-06-simple-interest.tex | tests_questions_bank_2/topics_modified/ch02-06-simple-interest.tex |
Use the exact same filename as the topic file it corresponds to.
Before writing any question bank files, run scripts/get_chapter_topic_facts.py to get the list of topics for the chapter you are working on:
python3 scripts/get_chapter_topic_facts.py --chapter <N>
This returns a structured report listing all core topics, additional topics, and modified topics for that chapter, along with:
Use this output to determine which question bank files need to be created. You must write question banks for every topic returned by the script — core, additional, and modified.
To see all available chapters:
python3 scripts/get_chapter_topic_facts.py --list-chapters
Before writing questions, always read the corresponding topic file first. The topic file tells you:
Your questions must test the content taught in that specific topic — not content from other topics. Stay within scope.
Write questions that are realistic and test-like — they should mirror the tone, structure, and rigor of actual state standardized math assessments. Avoid overly simplistic "drill" questions that just swap numbers. Instead, use the kinds of multi-step reasoning, real-world contexts, and precise academic language that students encounter on real tests.
Use the exact format shown below. Every file has:
X-Y-q01 through X-Y-q15)X-Y-q16 through X-Y-q21)X-Y-q22 through X-Y-q27) — 3 graphical MC + 3 graphical SAm-X-Y-q01 instead of X-Y-q01)Double-check every answer. An incorrect answer in a realistic test destroys student trust and undermines the book's credibility. Compute each answer carefully.
% ============================================================
% Question Bank: chXX-YY Topic Title
% Topic Title: Full Topic Title
% CCSS: 7.XX.X.X (or "Supplementary" for non-CCSS topics)
% Questions: 27 (15 MC + 6 SA + 6 Graphical)
% ============================================================
IDs follow the pattern {chapter}-{section}-q{number}:
ch01-01 → IDs are 1-1-q01 through 1-1-q27 (q01–q15 MC, q16–q21 SA, q22–q27 Graphical)ch03-05 → IDs are 3-5-q01 through 3-5-q27ch09-07 → IDs are 9-7-q01 through 9-7-q27ch02-08 → IDs are 2-8-q01 through 2-8-q27)m- to indicate modified content (e.g., m-2-6-q01 for a question in the modified version of chapter 2, section 6)Strip the leading zero from the chapter number. Keep the section number as-is (including leading zeros for single digits, but without the ch prefix).
\begin{practiceQuestion}{X-Y-q01}{mc}
\begin{questionText}
Question text goes here. Can span multiple lines.
Supports any LaTeX content: math, tables, TikZ, etc.
\end{questionText}
\choiceA{First option}
\choiceB{Second option}
\choiceC{Third option}
\choiceD{Fourth option}
\correctAnswer{B}
\explanation{A negative times a positive gives a negative: $(-4) \times 7 = -28$.}
\end{practiceQuestion}
\begin{practiceQuestion}{X-Y-q16}{sa}
\begin{questionText}
Question text goes here.
\end{questionText}
\correctAnswer{$42$}
\explanation{Multiply the base by the height: $6 \times 7 = 42$.}
\end{practiceQuestion}
gmc)Graphical questions include a TikZ figure or visual command as a core part of the question. The graphic is essential — students must interpret it to answer.
\begin{practiceQuestion}{X-Y-q22}{gmc}
\begin{questionText}
Look at the number line below. Which point represents $-\frac{3}{2}$?
\begin{center}
\numberLine[1]{-3}{3}
\end{center}
\end{questionText}
\choiceA{Point A}
\choiceB{Point B}
\choiceC{Point C}
\choiceD{Point D}
\correctAnswer{B}
\explanation{$-\frac{3}{2} = -1.5$ is halfway between $-2$ and $-1$ on the number line.}
\end{practiceQuestion}
gsa)\begin{practiceQuestion}{X-Y-q25}{gsa}
\begin{questionText}
What is the area of the composite figure shown below?
\begin{center}
\begin{tikzpicture}[scale=0.5]
\draw[step=1,gray!30,thin] (0,0) grid (8,6);
\draw[thick,->] (0,0) -- (8.5,0) node[right]{$x$};
\draw[thick,->] (0,0) -- (0,6.5) node[above]{$y$};
\fill[funBlue!30] (1,1) -- (7,1) -- (7,4) -- (4,5) -- (1,4) -- cycle;
\draw[thick,funBlue] (1,1) -- (7,1) -- (7,4) -- (4,5) -- (1,4) -- cycle;
\node[below] at (1,1) {$(1,1)$};
\node[below] at (7,1) {$(7,1)$};
\node[right] at (7,4) {$(7,4)$};
\node[above] at (4,5) {$(4,5)$};
\node[left] at (1,4) {$(1,4)$};
\end{tikzpicture}
\end{center}
\end{questionText}
\correctAnswer{$21$ square units}
\explanation{Rectangle base: $6 \times 3 = 18$. Triangle on top: $\frac{1}{2} \times 6 \times 1 = 3$. Total: $18 + 3 = 21$ square units.}
\end{practiceQuestion}
You have full creative freedom to build graphics that serve the question. Use whichever approach produces the clearest, most relevant visual:
VMfunMath.sty (see reference table below) — quick and consistenttabular, or minipage — for structured data displays\begin{center}...\end{center}Do NOT feel limited to the built-in commands. If a custom TikZ diagram better serves the question, write one. The goal is clarity, not using a specific command.
These are convenience commands from VMfunMath.sty. Use them when they fit naturally:
| Command | Description | Example |
|---|---|---|
\numberLine[step]{start}{end} | Number line with ticks | \numberLine[1]{-5}{5} |
\fractionBar[color]{num}{den} | Shaded fraction bar | \fractionBar{3}{4} |
\fractionCircle[color]{num}{den} | Shaded fraction circle | \fractionCircle{1}{4} |
\numberLineFraction[color]{den} | Fraction number line (0 to 1) | \numberLineFraction{6} |
\barGraph[color]{labels}{values}{ylabel} | Bar graph | (see VMfunMath.sty) |
\areaGrid[color]{rows}{cols} | Area model (filled squares) | \areaGrid{3}{5} |
\perimeterRect[color]{length}{width}{unit} | Rectangle with labeled sides | \perimeterRect{8}{5}{cm} |
\arrayGrid[color]{rows}{cols} | Dot array (rows × columns) | \arrayGrid{3}{4} |
\dotGroups[color]{groups}{per} | Grouped dots | \dotGroups{5}{3} |
\numberBond[color]{whole}{part1}{part2} | Number bond diagram | \numberBond{12}{4}{8} |
\baseTenBlocks{hundreds}{tens}{ones} | Base-10 block drawing | \baseTenBlocks{2}{3}{5} |
\factFamily{a}{b}{c} | Fact family triangle | \factFamily{3}{7}{21} |
\skipCountArc[color]{start}{end}{step} | Skip counting on number line | \skipCountArc{0}{20}{4} |
\columnAdd{num1}{num2} | Column addition layout | \columnAdd{345}{278} |
\columnSub{num1}{num2} | Column subtraction layout | \columnSub{503}{278} |
\placeValueTable{headers}{row1}{row2} | Place value chart | (see VMfunMath.sty) |
\tallyMarks{count} | Tally mark drawing | \tallyMarks{13} |
\ruler{length}{unit} | Ruler drawing | \ruler{12}{cm} |
\funCompare{left}{symbol}{right} | Comparison display | \funCompare{3.5}{>}{3.05} |
\equalSharing[color]{total}{groups} | Equal sharing diagram | \equalSharing{12}{3} |
\begin{center}
\begin{tikzpicture}
% Custom graphic — use whatever TikZ you need
\end{tikzpicture}
\end{center}
questionText is an environment, not a command. Always use \begin{questionText}...\end{questionText}, never \questionText{...}. This allows complex multi-line content including TikZ, tables, and graphs inside the question.mc, sa, gmc, or gsa — the second argument to practiceQuestion.\choiceA{} through \choiceD{}.\correctAnswer{} and \explanation{}.\correctAnswer{} for MC/GMC is the letter (A, B, C, or D). For SA/GSA it is the actual answer which must be very short (usually one or two words or numbers).\explanation{} is required for every question. Write 2–3 sentences that (a) name the concept, rule, or formula being used, (b) show the key computation, and (c) arrive at the correct answer. Students have just learned these topics — a bare equation is not enough. Always name the mathematical concept so the student connects the problem to what they studied.$...$. Use \times for multiplication, \div for division.\choiceA through \choiceD lines.\end{practiceQuestion} and the next \begin{practiceQuestion}.gmc/gsa) must include a TikZ figure, visual command, or table inside questionText. The visual is the core of the question — not a decoration.Note how the examples below use real-world contexts and test-like phrasing rather than bare computation. This is the standard to follow.
% ============================================================
% Question Bank: ch03-05 Multiplying Integers and Rational Numbers
% Topic Title: Multiplying Integers and Rational Numbers
% CCSS: 7.NS.A.2
% Questions: 27 (15 MC + 6 SA + 6 Graphical)
% ============================================================
% --- Multiple Choice Questions (15) ---
\begin{practiceQuestion}{3-5-q01}{mc}
\begin{questionText}
A scuba diver descends at a rate of $4$ feet per second. Which expression represents the diver's change in depth after $7$ seconds?
\end{questionText}
\choiceA{$4 \times 7 = 28$ feet}
\choiceB{$(-4) \times 7 = -28$ feet}
\choiceC{$4 + 7 = 11$ feet}
\choiceD{$(-4) + 7 = 3$ feet}
\correctAnswer{B}
\explanation{Descending means a negative rate: $(-4) \times 7 = -28$ feet (28 feet below the starting point).}
\end{practiceQuestion}
\begin{practiceQuestion}{3-5-q02}{mc}
\begin{questionText}
The temperature dropped $3^\circ$F each hour for $5$ hours. A student says the total change is $-8^\circ$F. Which statement best describes the student's error?
\end{questionText}
\choiceA{The student added instead of multiplied.}
\choiceB{The student forgot to make the product negative.}
\choiceC{The student multiplied correctly but dropped the negative sign.}
\choiceD{The student divided instead of multiplied.}
\correctAnswer{A}
\explanation{The correct change is $(-3) \times 5 = -15^\circ$F. The student computed $(-3) + (-5) = -8$, adding instead of multiplying.}
\end{practiceQuestion}
% ... (q03 through q15 follow the same pattern) ...
% --- Short Answer Questions (6) ---
\begin{practiceQuestion}{3-5-q16}{sa}
\begin{questionText}
A recipe calls for $\frac{3}{4}$ cup of sugar, but Maria wants to make only $\frac{2}{3}$ of the recipe. How many cups of sugar does Maria need?
\end{questionText}
\correctAnswer{$\frac{1}{2}$}
\explanation{Multiply: $\frac{2}{3} \times \frac{3}{4} = \frac{6}{12} = \frac{1}{2}$ cup.}
\end{practiceQuestion}
% ... (q17 through q21 follow the same pattern) ...
% --- Graphical Questions (3 GMC + 3 GSA) ---
\begin{practiceQuestion}{3-5-q22}{gmc}
\begin{questionText}
The number line below models a multiplication of two integers. Based on the diagram, which equation is represented?
\begin{center}
\begin{tikzpicture}
\draw[thick,->] (-4.5,0) -- (4.5,0);
\foreach \x in {-4,...,4} \draw (\x,0.1) -- (\x,-0.1) node[below] {$\x$};
\draw[thick,->,funBlue] (0,0.4) -- (-3,0.4);
\node[above,funBlue] at (-1.5,0.4) {$3$ jumps of $-1$};
\end{tikzpicture}
\end{center}
\end{questionText}
\choiceA{$3 \times 1 = 3$}
\choiceB{$3 \times (-1) = -3$}
\choiceC{$(-3) \times (-1) = 3$}
\choiceD{$(-1) \times (-3) = 3$}
\correctAnswer{B}
\explanation{The arrow shows $3$ groups of $-1$, moving left on the number line to $-3$.}
\end{practiceQuestion}
% ... (q23-q24 are gmc, q25-q27 are gsa) ...
Every question must feel like it belongs on a real state standardized math test. We need a variety of questions.
Aim for a mix across the 27 questions that mirrors real standardized tests:
$...$: All numbers in equations use math modegmc/gsa): The graphic shows ALL relevant info, is labeled, and students of the target age can instantly understand what it represents and how it connects to the questionWrong answers should reflect real student mistakes:
Never use obviously absurd distractors. Every option should look plausible to a student who has a specific misconception. On real standardized tests, distractors are carefully engineered — yours should be too.
SA questions should mirror the constructed-response or gridded-response items found on real standardized tests. The student produces an answer — usually a number, expression, or short phrase.
Keep \correctAnswer{} brief — a number, expression, or short phrase. Frame SA questions with the same real-world contexts and academic language used in the MC section.
Explanations appear in the answer key and help students learn from their mistakes. Remember: these students have just learned the topic — they need explanations that name the concept or rule being used, show the key steps, and connect the reasoning to the answer. A bare computation like $360 - 65 - 135 - 88 = 72$ is not an explanation — it's just arithmetic that the student could have done themselves.
Follow these rules:
GOOD explanations:
Descending means a negative rate of change. Multiply the rate by the time: $(-4) \times 7 = -28$ feet, meaning 28 feet below the starting point.Use cross-multiplication to solve a proportion: $3 \times 8 = 4x$, so $24 = 4x$ and $x = 6$.The slope formula is $m = \frac{y_2 - y_1}{x_2 - x_1}$. Substituting the points: $m = \frac{6-2}{4-1} = \frac{4}{3}$. Using point-slope form with $(1,2)$: $y = \frac{4}{3}x + \frac{2}{3}$.The interior angles of any quadrilateral sum to $360°$. Subtract the three known angles: $x = 360 - 65 - 135 - 88 = 72°$.Use the product rule for exponents: when multiplying powers with the same base, add the exponents. $4p^3 \times 3p^5 = 12p^{3+5} = 12p^8$.BAD explanations (too short / just computation, no concept named):
$360 - 65 - 135 - 88 = 72°$. ← no concept named, just arithmetic$12p^8$. ← no reasoning at allThe answer is $-28$. ← no reasoning shownB ← useless$\frac{15}{5} = 3$ and $y^{7-3} = y^4$. Answer: $3y^4$. ← just shows computation without naming the quotient ruleBAD explanations (too long):
First, we need to recall that when multiplying a negative number by a positive number, the result is always negative. This is because the signs are different. So we take the absolute values, which are 4 and 7, and multiply them to get 28. Then we apply the negative sign to get -28. Therefore the answer is -28. ← way too wordy for a simple sign ruleRun python3 scripts/get_chapter_topic_facts.py --chapter <N> to get the chapter title, topic names, and content summaries. Use that output to understand the scope, number ranges, and key constraints for the chapter you are writing. Stay within the scope described by each topic's summary — do not introduce content from other chapters or topics.
questionTextThe \begin{questionText}...\end{questionText} environment supports any LaTeX content. For topics that benefit from visuals, you can include tables, TikZ graphics, or other environments inside the question text.
gmc / gsa)Graphical questions use a visual element (TikZ diagram, chart, coordinate plane, number line, etc.) as the core of the question. The student must interpret the visual to answer — the graphic is not decoration.
Structure: 6 graphical questions per file (IDs q22-q27), placed after the SA questions:
gmc) — same structure as mc but with a visual in questionTextgsa) — same structure as sa but with a visual in questionTextThe #1 rule for graphical questions: a student of the target age (see script output) must instantly understand what the graphic shows and how it relates to the question. If there is any ambiguity, rewrite the question or redesign the graphic.
Before writing each graphical question, ask yourself:
\begin{center}...\end{center} for proper alignment.BAD — graphic is unrelated or partially related to the question:
Question: "A student says the constant of proportionality is 3. Is the student correct?"
Graphic: [a table showing only input values, no output values]
Problem: The question asks about proportionality but the graphic doesn't show
both quantities. The student has no way to verify the constant.
GOOD — graphic shows exactly what the question asks about:
Question: "Look at the graph below. What is the constant of proportionality?"
Graphic: [coordinate plane with a line through origin, points labeled]
Why it works: The student can SEE the line, read coordinates, and compute k.
BAD — graphic is decorative, not essential:
Question: "What is |-7|?"
Graphic: [a number line from -10 to 10 with -7 marked]
Problem: The number line doesn't add anything — the student still has to
recall the definition. The graphic is decoration.
GOOD — graphic is the core of the problem:
Question: "Look at the number line. What is the distance between point A
and point B?"
Graphic: [number line with A at -3.5 and B at 4.5, clearly labeled]
Why it works: The student must read both coordinates and find the distance.
| Topic Area | Natural Visual Types |
|---|---|
| Ratios & Proportional (Ch 1) | Coordinate graphs of proportional relationships, ratio tables, tape diagrams, unit rate slopes |
| Percents (Ch 2) | Bar models (part/whole), percent comparison diagrams, 10×10 grids, simple interest timelines |
| Rational Numbers (Ch 3) | Number lines with integers/fractions/decimals, comparison visuals, temperature/elevation contexts |
| Algebraic Expressions (Ch 4) | Algebra tile diagrams, expression area models, input/output tables |
| Equations & Inequalities (Ch 5) | Balance/scale diagrams, inequality number lines with open/closed circles, word problem diagrams |
| Geometry & Angles (Ch 6) | Scale drawings, triangles with given measurements, cross-section diagrams, angle diagrams with intersecting lines |
| Circles, Area, SA, Volume (Ch 7) | Circle diagrams with radius/diameter, composite shapes on grids, nets of 3D shapes, prism volume diagrams |
| Statistics (Ch 8) | Dot plots, box plots, histograms, side-by-side comparison displays, sampling diagrams |
| Probability (Ch 9) | Tree diagrams, sample space tables, spinner/dice diagrams, frequency tables, simulation results |
get_chapter_topic_facts.pyrun the lookup script for each chapter to get the authoritative list of topics:
python3 scripts/get_chapter_topic_facts.py --chapter <N>
The script prints a structured report containing:
tests_questions_bank_2/topics/tests_questions_bank_2/topics_additional/tests_questions_bank_2/topics_modified/For each topic the script outputs: topic ID, name, file path (relative to workspace root), summary, and (for additional/modified) which states use it.
You must create a question bank file for every topic the script returns — core, additional, and modified.
Important for modified topics: Read the modified version of the topic file (in topics_modified/), not the original in topics/. The questions should test the enhanced content that was added for state-specific standards.
When asked to write question banks, process one chapter at a time:
python3 scripts/get_chapter_topic_facts.py --chapter <N> to discover all topics for the chaptertests_questions_bank_2/ subdirectoryWrite question banks in batches of 5–8 topics at a time to maintain quality. After each batch:
python3 scripts/generate_practice_tests.py --bank 2 --states california --num-tests 3 to verify the parser picks up the new filesTrack which topics have been completed per chapter. Use the script's COUNTS section to know how many files each chapter needs.
The following environments and commands are defined in VM_packages/VMfunPractice.sty and are available when these files are compiled:
\begin{practiceQuestion}{ID}{type}...\end{practiceQuestion} — wrapper (type: mc, sa, gmc, or gsa)\begin{questionText}...\end{questionText} — auto-numbered question text\choiceA{}...\choiceD{} — multiple choice options (for mc and gmc)\correctAnswer{} — correct answer (hidden in student version)\explanation{} — explanation (hidden in student version)Types sa and gsa automatically render an answer box for students. Types gmc and gsa are identical to mc and sa in rendering — the type distinction exists only so the generation script can identify graphical questions.
After writing question bank files for a chapter, create a LaTeX file in tests/ named grade[number]_test_questions_bank_2_ch<N>.tex.
The file must follow the practice tests book pattern, not a plain chapter handout:
\enablePracticeTestAnswers\practiceTestPage{1}{<total question count>} so the answer system groups the content as a real practice testtests_questions_bank_2/\testScorePage{1}{<total question count>} before the answer key so the review feels like the practice test books\printAnswerKeyImportant: the compiled PDF must print both answers and detailed explanations at the end, in the same grouped format used by the practice test books. Using only \enablePracticeTestAnswers without \practiceTestPage is not enough.
python3 scripts/get_chapter_topic_facts.py --chapter <N> to discover topics, grade, and audiencetests_questions_bank_2/topics/, tests_questions_bank_2/topics_additional/, or tests_questions_bank_2/topics_modified/) and the header comment block present with topic title and question countq01-q15) + 6 SA (q16-q21) + 6 Graphical (q22-q27: 3 gmc + 3 gsa)gmc/gsa) include a TikZ figure or visual command that IS the question — not decoration and graphical visuals show ALL relevant information and are clearly labeled and graphical questions use varied visual typestests_questions_bank/ (bank 1) — no duplicate or near-duplicate questions across bankstests/ named grade[number]_test_questions_bank_2_ch<N>.tex that uses \practiceTestPage{1}{<total question count>}, clearly shows the grade/chapter/title, \inputs all new question bank files from tests_questions_bank_2/, adds \testScorePage{1}{<total question count>}, compiles successfully, and prints both answers and detailed explanations in the PDF