You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/en/AbInitio/Authoring_quick_start_1.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ There are lots of fields, but only a few are compulsory:
22
22
23
23
1. The "question name",
24
24
2. The "question text", which is shown to the student,
25
-
3. The teacher's "model answer" `ta` using a variable in the "question variables",
25
+
3. The teacher's "model answer" `ta1` using a variable in the "question variables",
26
26
4. A test of "correctness" (defaults to Algebraic equivalence).
27
27
28
28
By default a new question automatically has one [input](../Authoring/Inputs/index.md), and one algorithm to test correctness of the answer.
@@ -39,10 +39,10 @@ You must give the question a name, for example `question1`.
39
39
40
40
There should be text in question variables by default.
41
41
42
-
ta:?;
42
+
ta1:?;
43
43
We should replace `?` with the model answer to the question. In this case, this wil be the derivative of \((x-1)^3\), which is \(3(x-1)^2\). So we should replace `?` with `3*(x-1)^2`.
44
44
45
-
ta:3*(x-1)^2;
45
+
ta1:3*(x-1)^2;
46
46
47
47
48
48
### Question text ###
@@ -110,7 +110,7 @@ Each branch can then
110
110
We can leave the default settings for a minimal question, which is the following:
111
111
112
112
1. Specify the variable `ans1` in the `SAns` setting.
113
-
2. Specify the correct answer in the `TAns` setting: `ta`.
113
+
2. Specify the correct answer in the `TAns` setting: `ta1`.
114
114
3.`AlgEquiv` in the _Answer test_ drop-down menu.
115
115
116
116
## Saving the question
@@ -123,7 +123,7 @@ To recap, we have
123
123
124
124
1. The "question name",
125
125
2. The "question text",
126
-
3. The teacher's "model answer", (`ta` in the question variables).
126
+
3. The teacher's "model answer", (`ta1` in the question variables).
127
127
4. A test of "correctness" (set to Algebraic equivalence).
128
128
129
129
Next we should try out our question by pressing the `Preview` link at the bottom of the page.
Copy file name to clipboardExpand all lines: doc/en/AbInitio/Authoring_quick_start_2.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,8 +25,8 @@ We make more use of the question text field. For instance, we can start to use t
25
25
Add the following to the question variables
26
26
27
27
```
28
-
exp: 3*(x-1)^(-4);
29
-
ta: int(exp,x)+c;
28
+
ex1: 3*(x-1)^(-4);
29
+
ta1: int(ex1,x)+c;
30
30
```
31
31
32
32
The coding in question variables is based on Maxima, which has an unusual syntax for assignment. In particular, the colon `:` is used to assign a value to a variable. So to assign the value of `5` to `a1`, we use the syntax `a1:5`. In general, it is good practice to give variables multi-character names, as single-character names are meant for student input. This is because multi-character variables the author defined cannot by default be input by students. Additionally, adding semicolons to the end of each line is optional, but good practice.
@@ -35,21 +35,21 @@ Notice we are using the CAS to determine the model answer by calling the `int()`
35
35
36
36
Now it will be a lot faster to fill out the rest of the question. Add the following to the question text:
37
37
38
-
<p>Find \(\int{@exp@} \mathrm{d}x\)</p>
38
+
<p>Find \(\int{@ex1@} \mathrm{d}x\)</p>
39
39
<p>[[input:ans1]] [[validation:ans1]]</p>
40
40
41
-
Notice that we have defined a local variable `exp`, and used the value of this in the Question text. There is a difference between mathematics enclosed between `\(..\)` symbols and `{@..@}` symbols. All the text-based fields in the question, including feedback, are [CAS text](../Authoring/CASText.md). This is HTML into which mathematics can be inserted. LaTeX is placed between `\(..\)`s, and CAS expressions (including your variables) between matching `{@..@}` symbols. The CAS expressions are evaluated in the context of the question variables and displayed as LaTeX.
41
+
Notice that we have defined a local variable `ex1`, and used the value of this in the Question text. There is a difference between mathematics enclosed between `\(..\)` symbols and `{@..@}` symbols. All the text-based fields in the question, including feedback, are [CAS text](../Authoring/CASText.md). This is HTML into which mathematics can be inserted. LaTeX is placed between `\(..\)`s, and CAS expressions (including your variables) between matching `{@..@}` symbols. The CAS expressions are evaluated in the context of the question variables and displayed as LaTeX.
42
42
43
-
Since we have used `{@exp@}` here, the user will not see a \(exp\) on the screen when the question is instantiated, but the _displayed value_ of `exp`: \(\frac{3}{(x-1)^{-4}}\)
43
+
Since we have used `{@ex1@}` here, the user will not see a \(ex1\) on the screen when the question is instantiated, but the _displayed value_ of `ex1`: \(\frac{3}{(x-1)^{-4}}\)
44
44
45
-
In the input `ans1`, confirm the default `model answer` is the variable `ta`.
45
+
In the input `ans1`, confirm the default `model answer` is the variable `ta1`.
46
46
47
-
In the potential response tree, confirm the default `Answer test` is `AlgEquiv`, `SAns` is `ans1` and `TAns` is `ta`.
47
+
In the potential response tree, confirm the default `Answer test` is `AlgEquiv`, `SAns` is `ans1` and `TAns` is `ta1`.
48
48
49
49
It is good practice to use question variables often, as they save time and let you change properties of the question easily in the future.
50
50
51
51
# Next step #
52
52
53
53
You should now be able to use question variables in STACK.
54
54
55
-
##### The next part of the authoring quick start guide looks at [improving feedback](Authoring_quick_start_3.md).
55
+
##### The next part of the authoring quick start guide looks at [improving feedback](Authoring_quick_start_3.md).
In the last part we started working with question variables. Specifically, we defined the variable `exp` for the expression to be integrated, and `ta` for the teacher's answer. Then we asked the student to find \(\int 3(x-1)^{-4}dx\).
12
+
In the last part we started working with question variables. Specifically, we defined the variable `ex1` for the expression to be integrated, and `ta1` for the teacher's answer. Then we asked the student to find \(\int 3(x-1)^{-4}dx\).
13
13
14
14
Try previewing this question and typing in `-1*(x-1)^(-3)+c`. The system should accept this as correct. Next type in `-1*(x-1)^(-3)+C`. This will be compared to the teacher's answer `-1*(x-1)^(-3)+c` by algebraic equivalence (recall we specified `AlgEquiv` in the potential response tree), and will not be accepted as equivalent. The reason is that `c` and `C` are different. A reasonable teacher will probably not care which letter is used for the constant of integration. Let us fix this problem.
Copy file name to clipboardExpand all lines: doc/en/AbInitio/Authoring_quick_start_4.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,23 +14,23 @@ In the last part, we worked with a problem about integrating \(3(x-1)^{-4}\) wit
14
14
Let's take a look again at the question variables we declared:
15
15
16
16
```
17
-
exp: 3*(x-1)^(-4);
18
-
ta: int(exp,x)+c;
17
+
ex1: 3*(x-1)^(-4);
18
+
ta1: int(ex1,x)+c;
19
19
```
20
20
21
-
We defined two local variables `exp` and `ta`, and used these values in other places such as the question text, input and potential response tree.
21
+
We defined two local variables `ex1` and `ta1`, and used these values in other places such as the question text, input and potential response tree.
22
22
23
23
We are now in a position to generate a random question. To do this, modify the [question variables](../Authoring/Variables.md#Question_variables) to be
24
24
25
25
```
26
26
a1 : 1+rand(6);
27
27
a2 : 1+rand(6);
28
28
nn : 1+rand(4);
29
-
exp : a1*(x-a2)^(-nn);
30
-
ta: int(exp, x)+c;
29
+
ex1 : a1*(x-a2)^(-nn);
30
+
ta1: int(ex1, x)+c;
31
31
```
32
32
33
-
In this new question we are asking the student to find the anti-derivative of a question with a definite form \( a_1(x-a_2)^{-nn} \). `a1`, `a2` and `nn` are all variables which are assigned random positive integers. These are then used to define the variable `exp`, used in the question itself. We also have the CAS integrate the expression `exp` and store the result in the variable `ta`. It is good practice to use variables names with more than one character as single-character variables, like `x`, are meant for student input.
33
+
In this new question we are asking the student to find the anti-derivative of a question with a definite form \( a_1(x-a_2)^{-nn} \). `a1`, `a2` and `nn` are all variables which are assigned random positive integers. These are then used to define the variable `ex1`, used in the question itself. We also have the CAS integrate the expression `ex1` and store the result in the variable `ta1`. It is good practice to use variables names with more than one character as single-character variables, like `x`, are meant for student input.
34
34
35
35
Remember that when generating random questions in STACK we talk about _random numbers_ when we really mean _pseudo-random numbers_. To keep track of which random numbers are generated for each user, there is a special `rand` command in STACK, which you should use instead of [Maxima](../CAS/Maxima_background.md)'s random command. The `rand` command is a general "random thing" generator, see the page on [random generation](../CAS/Random.md) for full details. `rand` can be used to generate random numbers and also to make selections from a list. `rand(n)` will select a random integer from 0 up to, **and not including**, `n`. So `rand(3)` will select a random number from the list `[0,1,2]` .
36
36
@@ -40,7 +40,7 @@ Now that as our question contains random numbers, we need to record the actual q
40
40
Fill the question note in as
41
41
42
42
```
43
-
\[ \int {@exp@} \mathrm{d}x = {@ta@}.\]
43
+
\[ \int {@ex1@} \mathrm{d}x = {@ta1@}.\]
44
44
```
45
45
46
46
Two question variants are considered to be the same if and only if the question note is the same. It is the teacher's responsibility to create sensible notes.
Copy file name to clipboardExpand all lines: doc/en/AbInitio/Authoring_quick_start_5.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,8 +13,8 @@ In the last couple of parts, we have been working with a simple integration ques
13
13
a1 : 1+rand(6);
14
14
a2 : 1+rand(6);
15
15
nn : 2+rand(4);
16
-
exp : a1*(x-a2)^(-nn);
17
-
ta: int(exp, x)+c;
16
+
ex1 : a1*(x-a2)^(-nn);
17
+
ta1: int(ex1, x)+c;
18
18
```
19
19
20
20
Testing questions is time consuming and tedious, but important to ensure questions work. To help with this process, STACK enables teachers to define "question tests". The principle is the same as "unit testing" in software engineering.
@@ -30,22 +30,22 @@ The penalty is a number deducted from the total mark for each incorrect attempt
30
30
Fill in the following information for your first test case:
31
31
32
32
```
33
-
ans1 = ta
33
+
ans1 = ta1
34
34
score = 1
35
35
penalty = 0
36
36
answernote = prt1-2-T
37
37
```
38
38
39
39
I.e., if the student puts in the model answer they should pass the first node (checks if they have integrated correctly) and pass the second node (tests that their answer is factored) and end up with a score of 1 and no penalty.
40
40
41
-
Note that the input is evaluated before the test is conducted. Students are not allowed to enter the variable `ta` because it is a teacher-defined variable, however the evaluated form, fx. `-1*(x-1)^(-3)+c`, is an allowed input. For each test case, you can see the un-evaluated input under `Test input`, and the actual input tested under `Value entered`.
41
+
Note that the input is evaluated before the test is conducted. Students are not allowed to enter the variable `ta1` because it is a teacher-defined variable, however the evaluated form, fx. `-1*(x-1)^(-3)+c`, is an allowed input. For each test case, you can see the un-evaluated input under `Test input`, and the actual input tested under `Value entered`.
42
42
43
43
You can run the test on all deployed versions by clicking on `Run all tests on all deployed variants` .
44
44
45
45
You can add as many tests as you think is needed, and it is usually a sensible idea to add one for each case you anticipate. Add in another test case for
Copy file name to clipboardExpand all lines: doc/en/Authoring/Answer_Tests/Equivalence.md
+19-2Lines changed: 19 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ This list is in approximate order of the size of the equivalence classes from mo
20
20
21
21
### AlgEquiv {#AlgEquiv}
22
22
23
-
This is the most commonly used test. The pseudo code
23
+
This is the most commonly used test. The pseudo code (for mathematical _expressions_ at least) is
24
24
25
25
If
26
26
simplify(ex1-ex2) = 0
@@ -38,7 +38,24 @@ Note: exactly what this answer test does depends on what objects are given to it
38
38
39
39
For sets, the CAS tries to write the expression in a canonical form. It then compares the string representations these forms to remove duplicate elements and compare sets. This is subtly different from trying to simplify the difference of two expressions to zero. For example, imagine we have \(\{(x-a)^{6000}\}\) and \(\{(a-x)^{6000}\}\). One canonical form is to expand out both sides. While this work in principal, in practice this is much too slow for assessment.
40
40
41
-
Currently we do check multiplicity of roots, so that \( (x-2)^2=0\) and \( x=2\) are not considered to be equivalent. Similarly \(a^3b^3=0\) is not \(a=0 \text{ or } b=0\). This is a long-standing issue and we would need a separate test to ignore multiplicity of roots.
41
+
Equations and expressions are very different. Two equations are equivalent if they have the same roots with the same multiplicity of roots. For example, \((x-2)^2=0\) and \(x=2\) are not considered to be equivalent. Similarly \(a^3b^3=0\) is not \(a=0 \text{ or } b=0\). To establish equivalence of equations we use the pseudo code
That is to say, we turn the equation `ex1` into an expression `x1:simplify(lhs(ex1)-rhs(ex1))` and the equation `ex2` into an expression `x2:simplify(lhs(ex2)-rhs(ex2))`, and then simplify the ratio of the two numerators of `x1` and `x2`:, i.e. `num(x1)/num(x2)` (with some edge case detection of course). If this is a number then we have cancelled algebraic factors precicely, and roots match (with multiplicity). Notice we do not actually "solve" the equations during this process, thereby side-stepping the decidability question. (We would need a separate test to ignore multiplicity of roots.)
51
+
52
+
In calculating the ratio `x1/x2` we use Maxima's simplifer, which may be modified by commands like `assume`. However, since we do not actually solve the equations we do not use `assume` to reject solutions themselves. For example, in the following situation
53
+
54
+
assume(x>0);
55
+
eq1: a = (c*x^3)/x;
56
+
eq2: a*x = c*x^3;
57
+
58
+
`eq1` does not have \(0\) as a solution, whereas `eq2` does have \(0\) as a solution, the ratio simplifes to `1/x` indicating that `eq2` has a zero solution which is not balanced by a corresponding solution in `eq`. Since the equations are never solved, the `assume(x>0)` never comes into play here. (We would need a separate test to use `assume` statements and reject roots.)
42
59
43
60
Inequalities are turned into sets of real numbers they represent. When this is done it is indicated by the answer note `ATInequality_solver.` If you want `a>1` to be _not_ the same as `x>1` then you need to test in a more syntactic way, not using algebraic equivalence.
0 commit comments