In my view, the Grades 1-9 Ontario mathematics curricula are the strongest I’ve seen anywhere. The most significant—most wonderful—innovation is the integration of coding (computer programming) and mathematics, across grades 1-9.

EQAO assessments serve as models for educators and education leaders of what should be taught in classrooms. How do Grade 3 EQAO assessments model the integration of mathematics and coding, and how may they be improved?
A Grade 3 EQAO question
Let’s take a close look at an EQAO question.
Shown below is a 2025 Grade 3 EQAO question (from https://www.eqao.com/math-resource-released-questions-g3-2025)

This question may address the following Grade 3 curriculum expectation:
C3.2 read and alter existing code, including code that involves sequential, concurrent, and repeating events, and describe how changes to the code affect the outcomes
Students are asked to read 4 different versions of code excerpts that use a repeating event (loop), and decide which one would create the outcome of “add 5 to number” 3 times.
The question may also address the expectation below, as “number” is a variable.
C2.1 describe how variables are used, and use them in various contexts as appropriate
The problem
There are a number of issues with this question.
- Although the question refers to lines of “code”, these are actually lines of “pseudocode” (pseudo means fake).
- The (pseudo)code in the question is a fragment. It lacks computational context. It also lacks mathematical context. This is a missed opportunity to model for students and educators how coding may be used to bring mathematics concepts and relationships to life .
- None of the 4 offered solution choices are correct. As written, none of the 4 solution choices would repeat the second line in the pseudocode. In real code, when a repeat code block is created, what is repeated is clearly identified as belonging to the repeat block. This is illustrated below in Scratch and Python, respectively.

DESIGNING Better questionS
Let’s connect variables and repeating events in a way that brings the meaning of variable to life dynamically.
Question context
The Scratch code below creates a spiral path.
(You can try it at: https://scratch.mit.edu/projects/1276834449/editor)

Question 1
Which one of the 4 edits to the code would create this spiral pattern?

Question 2
Which one of the 4 edits to the code would create this spiral pattern?

In the classroom
Repeating events
In grade 3, we begin by giving children existing Scratch code where a bug walks a square.
(You can try it at: https://scratch.mit.edu/projects/1276829944/editor)

Students run the code and observe what happens. Then we challenge them to modify it so that the bug walks:
- a bigger or smaller square, and
- a triangle or a hexagon.
After experimenting, they share their insights about how the code works.
Here, we start with live code and a puzzle. The code does something mathematical, and it represents ideas dynamically.
This is exactly what the curriculum envisions.
A variable in action
Next, we display this spiral pattern and ask students to pair, share, and discuss how they might modify the “walk a square” code to make the bug walk a spiral.

Students can describe the pattern verbally—walk, turn, walk a bit farther, turn, walk farther again—but they don’t yet know how to implement this in real code because they haven’t learned about variables.
So we say:
“I found some code that does this. Try it out. Explore how it works.”

We show them the working spiral code. They run the code to see what it does.
(You can try it at: https://scratch.mit.edu/projects/1276834449/editor)
Then we invite students, working in pairs, to modify this code to create the spiral patterns shown below.

Learning incidentally
Notice that we give students existing code that works, along with puzzles that require them to modify it. Code—like a bicycle, and unlike pseudocode—is alive. It is best learned through use, incidentally, through exploration, through meaningful mathematical activity.

This is coding as the curriculum intends it: dynamic, conceptual, mathematical.
Transforming mathematics education
Through the classroom activities shared above, what students experience, learn and understand about variables—and about algebra—is very different from what we learned in school.
When we ask adults what variables and algebra are about, the most common response is something like:
Algebra is when you solve an equation like x + 5 = 12, and x is the variable whose value you have to find.
But in x + 5 = 12, x is not actually a variable at all.
It is a constant—specifically, x = 7. Nothing in the situation varies.
And algebra is not fundamentally about finding the value of a constant.
Algebra is about relationships between quantities that change.
A genuine variable is something that varies—like in the spiral‑walking code, where both the repeat count and the step length change together in a coordinated way. Their values shift in relation to one another. That relationship is the algebra.
Real algebra is dynamic, not static.
It’s about expressing, exploring, and understanding how quantities co‑vary—not about uncovering a single hidden number.
This is the mathematics children need to learn.
Understanding mathematics and coding
Need more ideas on this theme? See https://imaginethis.ca/u
Need help implementing mathematics + coding? I am happy to offer online meetings/sessions with lead teachers and curriculum designers. See my contact info at https://imaginethis.ca/about









