If a given exercise has two or more parameters that influence the path the answer takes, then there are a few different ways to go about it. In this article one of the methods will be presented, as well as an example.
Say we have two values, A and B, between 0 and 1 with one decimal place. Both are randomly chosen in that range for each different student through the Range operator:
The relationship between A and B determines which of the two paths the calculation of the answer takes. If A is greater than B, then it takes Path I. If A is smaller than or equal to B, the Path II is chosen. Each path has a different formula, as it can be seen above.
The next step is setting up the answers so that the correct cases are evaluated. In this example there are four possibilities:
| A greater than B | A smaller than or equal to B |
Student uses Path I | Correct | Incorrect |
Student uses Path II | Incorrect | Correct |
So the four cases have to be accounted for in the "Edit answers and specific feedback" screen. An additional parameter in the "Student answer dependent variables" is also created to account for the difference between A and B:
So the four different cases look as following:
The final exercise looks like this:
The example shown above is a very simple one, as the intention is to demonstrate the logic behind the question.
Alternative scenarios
Some alternative scenarios may arise where, unlike the example presented above, the parameters can't be calculated using formulas. For example, say there are parameters A, B and C. A and B can be either 0 or 1, and C can be 0, 1 or 2.
A | B | C |
0 | 0 | 0 |
0 | 1 | 2 |
1 | 0 | 2 |
1 | 1 | 1 |
C is to be used in different formulas, but it can't be easily calculated from A and B like it was in the previous example. One way of solving this is by uploading a .csv file like the table above, covering all the possibilities for C, and then using that in the calculations.