Multi-part algebra
From arithmetic to algebra
In the previous section, you saw how to define a solution model for multi-part arithmetic exercises. We will now extend this to questions that involve algebra. The difference between algebra and arithmetic questions is that the solution uses variables and equations. Here are two examples of multi-part problems that involve algebra:
- "Find the formula of the linear line intersecting and ."
- "A rectangular piece of land has an area of . The length of the land is longer than the width. What is the total length of a fence surrounding this land?"
We will create both examples using the Multistep question type. You can try them in the live examples below:
Live example: The multi-part algebra problems.
Example 1: The formula of a line
Consider the first example.
Find the formula for the line intersecting and .
The solution to this problem requires the following parts:
- Calculate the slope,
- Find the -offset, , by substituting one of the given points
- Write the formula for .
We turn this into a solution model as follows:
| Part | Description | Calculation | Marks |
|---|---|---|---|
| the requested formula | 1 | ||
| the slope | 1 | ||
| the -intercept | Solve for | 1 |
Note that we did not define the part for as , which is the answer to the problem. Instead, we keep variables and to let Algebrakit know these are required to find the solution. You can also see that the slope is needed to calculate the -offset. Algebrakit will first calculate the slope, then the -intercept, and finally the solution.
Now, let's create this question in Multistep.
- Add two new intermediate parts and name them and .
- Add the variables , and .
- Add the descriptions to the parts as given in the solution model.
- Set the tasks corresponding to the calculations in the solution model.
- Click on the part named and choose task Solve equations in the dropdown labelled "Task".

Variables
An important step is adding the variables to exercise parts , and . Names of exercise parts are just references to other parts for authoring purposes. Students never see the names and cannot use them in their work. However, students can use variables in their work.
The names of parts and their variables do not need to be the same. If you renamed the parts to "solution", "slope" and "offset", the exercise would still work identically, as long as the variables stay the same.
If you do not add variables to parts and , Algebrakit will not correctly interpret expressions that involve these variables. Here are some examples.
| Student input | Evaluation with student variables | Evaluation without student variables |
|---|---|---|
| Correct intermediate step. Algebrakit understands and still need to be calculated. | Incorrect. Algebrakit does not allow using or . | |
| Correct intermediate step. The input is assumed to correspond to the slope. | Same | |
| Correct intermediate step. Algebrakit understands that is the slope, which equals -2. | Incorrect. Algebrakit does not interpret as the slope. | |
| Correct intermediate step. Algebrakit knows that and , so the relation is valid. | Incorrect. Algebrakit does not allow using or . |
This is a significant improvement. Students can now build their solutions by writing formulas and equations first and solving them later. From a didactical point of view, we transitioned from arithmetic to algebraic thinking.
Example 2: An algebra word problem
We will now create the second example question:
A rectangular piece of land has an area of . The length of the land is longer than the width.
What is the total length of a fence that surrounds this land?
You can solve this problem in two ways:
- Calculating the width first:
- Find the width by solving equation
- Find the circumference as .
- Calculating the length first:
- Find the height by solving equation
- Find the circumference as .
Which results in the following solution models:
| Part | Description | Calculation | Marks |
|---|---|---|---|
| the width of the land | Solve | 1 | |
| the length of the fence | 1 |
| Part | Description | Calculation | Marks |
|---|---|---|---|
| the length of the land | Solve | 1 | |
| the length of the fence | 1 |
You add these to Multistep as follows:
- Add two new exercise parts with names and .
- Add the variable to the solution part.
- Add variables and to their respective intermediate parts.
- Add the descriptions to all exercise parts
- Set the tasks. Use the Simplify task for and the Solve equations task for and .
If you test the exercise, you will see that Algebrakit complains about the variable .

The issue is that the equation has two solutions: and . To not complicate things, Algebrakit only allows using as a variable if it has a single result. You can solve this problem by adding the domain to the equation, as shown below:

Add a domain to exercise part as well. You should now be able to run the question.
Free variables
The exercise already works well. You can apply algebraic thinking, using formulas and equations for variables , , and , and Algebrakit will understand. But we can go even further.
The instruction does not mention variables and . Moreover, the question does not indicate that you should use variables at all. It is up to the student to come up with that approach. Learning that you should use variables here is an example of modelling, an important mathematical skill.
So now we have the problem that the solution model assumes students use variables or , but we don't want to include that information in the instruction. The solution is to declare and as free variables. Using a free variable means students do not have to use the same variable name. Instead, they are free to choose their own name.
You declare a free variable in the symbols tab on the top bar.

The example below shows an example of a correct solution to this problem.

A free variable must be a single symbol. So students cannot use a variable name like ''.
Restrictions when using variables
These examples show how variables are a powerful concept that helps students apply algebraic thinking. However, there are a few limitations when using this technique.
- Variables must have exactly one solution. We saw this already in the second example. If an equation defines the variable, you might have to add a domain. Note that it is also not ok if the equation has no solutions.
- Variables cannot refer to each other. Assume and are variables. We can define to be dependent on or to be dependent on , but not both. If the task for depends on and the task for depends on , then Algebrakit will show an error message if you try to run the exercise. The reason is that no order exists to calculate the results for each part. Algebrakit currently does not support exercises with this type of circular definition.