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/Question_blocks/Static_blocks.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,6 +92,12 @@ The template block has two parameters, the first being a name which should be a
92
92
93
93
Note in the background templates are just functions with CASText values. You can do the same with inline CASText and more importantly building your own functions allows you to use arguments for them and thus makes repetition with varying parameters simpler. For templates no arguments exist, for them the values come from the context where they get placed in, and must therefore be controlled though other means.
94
94
95
+
Note that if you wish to use a template in both the question text and in the PRT feedback, you will need to define it in the question variables (in particular, if you define the template in the question text, it will not work in the PRT feedback since the PRT feedback is evaluated in a different scope from the question text). For instance:
96
+
97
+
define_my_template: castext("[[template name="foobar"]]Whatever is {@whatever@}[[/template]]");
98
+
99
+
You can then use `[[template name="foobar"/]]` throughout the question.
100
+
95
101
## Entity escape block ##
96
102
97
103
Sometimes one needs to author content that uses characters that are sensitive in HTML syntax. If one wraps that content in this block those characters will be automatically converted to HTML-entities during output. Can be very useful when including sample blocks of code, that includes certain operators. `[[entityescape]] code with some less than chars [[/entityescape]]`.
Copy file name to clipboardExpand all lines: doc/en/Developer/Development_track.md
+4-10Lines changed: 4 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,28 +11,23 @@ Issues with [github milestone 4.13.0](https://github.com/maths/moodle-qtype_stac
11
11
12
12
1. Remove all "cte" code from Maxima - mostly install.
13
13
2. Support for Maxima 5.47.0, 5.48.0, and 5.49.0. This includes a fix for issue #1281 from 5.48.0.
14
+
3. Question tests can now test the whole route through a PRT, rather than just the final node. This is a significant improvement on the ability to test questions. This is back-compatible with older questions.
14
15
15
16
--------------------------------------
16
-
## Testing a node, not a whole tree
17
17
18
-
This section is a detailed design proposal to improve question testing to test a node, not a whole tree, and address issue #1703.
19
-
20
-
### Change of `expectedanswernote`
21
-
22
-
Make DB changes to considerably lengthen `expectedanswernote` from 255 chars: https://github.com/maths/moodle-qtype_stack/blob/master/db/install.xml#L178
18
+
## Better testing
23
19
24
20
### Add in a new keyvals field "test variables".
25
21
26
22
Add in a new keyvals field "test variables". The test execution would then take three CAS sessions.
27
23
28
-
1.Loading up the seed, question variables, test variables and all input definitions, generating input "strings".
24
+
1. Loading up the seed, question variables, test variables and all input definitions, generating input "strings".
29
25
2. Those "strings" would then go through PHP side input validation and CAS side validation in the second CAS session.
30
26
3. Finally, the valid strings would be fed to the PRT functions in the last session, and logic to check if the PRT output matches would be included in that session, so that we do not need to output the full PRT function output for potentially a large number of tests, instead just booleans.
31
27
32
-
### Other ideas (later)
28
+
Other ideas
33
29
34
30
1. It would be a fun (student project?!) to graphically illustrate the expected and actual route through the tree by expanding the current PRT graph library, or writing something else. (I get ahead of myself of course....)
35
-
36
31
2. Introduce new keyword `any` in score/penalty effectiveley ignoring that field for the purposes of this test case.
37
32
38
33
Currently, the DB fields for score and penalty are numbers, specifically
@@ -42,7 +37,6 @@ Currently, the DB fields for score and penalty are numbers, specifically
* @param[list] parts A list with three elements (see vector_parametric_parts) [mx1 matrix of constants, a list of mx1 matrices of constants, a list of variable names]
116
116
* @return[string] TeX output of a vector parametric equation in a "standard" form.
0 commit comments