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
This is an **EXPERIMENTAL** evaluation function with some dimensional analysis functionality.
3
2
4
-
This function lacks a nice GUI, can be quite brittle, and will likely change significantly in the near future.
3
+
Evaluation function which proveds some basic some dimensional analysis functionality.
4
+
5
+
-**DEPRECATED** Comparing physical quantities **RECOMMENDED ALTERNATIVE:** CompareExpressions with the `physical_quantity` parameter set to `true`
6
+
- Substitutions of symbols before comparison of expressions is done
7
+
- Checking if a comma separated list of expressions can be interpreted as a set groups that satisfies the Buckingham Pi theorem
5
8
6
9
**Note:** When the `quantities` grading parameter is set, this function cannot handle short form symbols for units. Thus when defining quantities all units must be given with full names in lower-case letters. For example `Nm/s` or `Newton*metre/SECOND` will not be handled correctly, but `newton*metre/second` will.
7
10
@@ -21,11 +24,40 @@ This function lacks a nice GUI, can be quite brittle, and will likely change sig
21
24
22
25
**Note:** When running the unit test some tests are expected to take much longer than the other. These tests can be skipped by adding `skip_resource_intensive_tests` as a command line argument to improve iteration times.
23
26
27
+
## Changing default feedback messages
28
+
29
+
The feedback messages can be set on a per-task basis (see description of the `custom_feedback` input parameter).
30
+
31
+
The default feedback messages are defined in `feedback_responses_list` defined near the top of `evaulation.py`, which contains a list of dictionaries of feedback responses that are used througout the code. All feedback messages visible to learners are defined in these dictionaries. The entries in the dictionaries are either be string of functions that return strings.
32
+
24
33
## Inputs
25
34
All input parameters need to be supplied via the **Grading parameters** panel.
26
35
27
36
There are seven optional parameters that can be set: `elementary_functions`, `substitutions`, `quantities`, `strict_syntax`, `rtol`, `atol` and `comparison`.
28
37
38
+
## `custom_feedback`
39
+
40
+
Custom feedback can be set on a per-task basis. **Note:** Custom feedback only supports fixed strings, this means that for some situations the custom feedback cannot be as detailed as the default feedback.
41
+
42
+
The parameter must be set as a dictionary with keys from the feedback tags listed below. The value for each key can be any string.
43
+
44
+
### Feedback tags for all comparisons
45
+
-`PARSE_ERROR_WARNING` Response cannot be parsed as an expression or physical quantity.
46
+
-`PER_FOR_DIVISION` Warns about risk of ambiguity when using `per` instead `/` for division.
47
+
-`STRICT_SYNTAX_EXPONENTIATION` Warns that `^` cannot be used for exponentiation when `strict_syntax` is set to `true`.
48
+
-`QUANTITIES_NOT_WRITTEN_CORRECTLY` Text in error message that appears if list of quantities could not be parsed.
49
+
-`SUBSTITUTIONS_NOT_WRITTEN_CORRECTLY` Text in error message that appears if list of substitutions could not be parsed.
50
+
51
+
### Feedback tags for `buckinghamPi` comparison
52
+
53
+
-`VALID_CANDIDATE_SET` Message that is displayed when a response is found to be a valid set of groups. **Note:** setting this will not affect the Correct/Incorrect message, it will only add further text.
54
+
-`NOT_DIMENSIONLESS` Message displayed when at least one groups is not dimensionless.
55
+
-`MORE_GROUPS_THAN_REFERENCE_SET` Message displayed when the response contains more groups than necessary.
56
+
-`CANDIDATE_GROUPS_NOT_INDEPENDENT` Message displayed when the groups in the response are not independent.
57
+
-`TOO_FEW_INDEPENDENT_GROUPS` Message displayed when the response contains fewer groups than necessary.
58
+
-`UNKNOWN_SYMBOL` Message displayed when the response contains some undefined symbol.
59
+
-`SUM_WITH_INDEPENDENT_TERMS` Message displayed when the response has too few groups but one (or more) of the groups is a sum with independent terms.
60
+
29
61
## `elementary_functions`
30
62
31
63
When using implicit multiplication function names with mulitple characters are sometimes split and not interpreted properly. Setting `elementary_functions` to true will reserve the function names listed below and prevent them from being split. If a name is said to have one or more alternatives this means that it will accept the alternative names but the reserved name is what will be shown in the preview.
@@ -60,8 +92,6 @@ If the `comparison` parameter is set to `buckinghamPi`, then `quantities` should
60
92
61
93
#### Table: Base SI units
62
94
63
-
These tables list the units defined in `unit_system_conversions.py`. Note that the evaluation function uses static version of these arrays created by running `generate_unit_conversion_arrays.py` and stored in `static_unit_conversion_arrays.py`.
64
-
65
95
SI base units taken from Table 1 of https://physics.nist.gov/cuu/Units/units.html
66
96
67
97
Note that gram is used as a base unit instead of kilogram.
@@ -101,29 +131,29 @@ Note that degrees Celsius is omitted.
101
131
102
132
Note that the function treats radians and steradians as dimensionless values.
103
133
104
-
| Unit name | Symbol | Expressed in base SI units |
| fluid ounce | fl oz | $28.4130625~\mathrm{millilitre}$ |
207
+
| gill | gi | $142.0653125~\mathrm{millilitre}$ |
208
+
| pint | pt | $568.26125~\mathrm{millilitre}$ |
209
+
| quart | qt | $1.1365225~\mathrm{litre}$ |
210
+
| gallon | gal | $4546.09~\mathrm{litre}$ |
211
+
| ounce | oz | $28.349523125~\mathrm{gram}$ |
212
+
| pound | lb | $0.45359237~\mathrm{kilogram}$ |
213
+
| stone | st | $6.35029318~\mathrm{kilogram}$ |
165
214
166
215
### `strict_syntax`
167
216
@@ -188,7 +237,7 @@ Parameter that determines what kind of comparison is done. There are four possib
188
237
-`dimensions` Checks that the answer and response have the same dimensions, does not compare the values of the physical quantities.
189
238
-`buckinghamPi` Checks that the set of quantities in the response matches the set of quantities in the sense given by the Buckingham Pi theorem.
190
239
191
-
For more details on each options see the description below and the correspondig examples.
240
+
For more details on each options see the description below and the corresponding examples.
192
241
193
242
If `comparison` is not specified it defaults to `expression`.
194
243
@@ -213,17 +262,8 @@ With this option the quantities (specified by the `quantities` parameter) can be
213
262
Checks that the set of quantities in the response matches the set of quantities in the sense given by the Buckingham Pi theorem.
214
263
215
264
There are three different ways of supplying this function with the necessary information.
216
-
- In the answer, supply a list of groups on the form `['` first group `','` second group `','` ... `','` last group `']`. Note that if there is only one group it still needs to be written as a list `['` group `']`. When used this way the function assumes that the given list is correct and contains at least the minimum number of groups.
265
+
- In the answer, provide an example set of groups as a comma seprated list. When used this way the function assumes that the given list is correct and contains at least the minimum number of groups.
217
266
- In the `quantities` parameter, supply a list of what the dimensions for each quantity is and set answer to `-`. The function will then compute a list of sufficiently many independen dimensionless quantities and compare to the response.
218
267
- In the `quantities` parameter, supply a list of what the dimensions for each quantity is and in the answer, supply a list of groups as in the first option. The function will then check that the supplied answer is dimensionless and has a sufficient number of independent groups before comparing it to the response.
219
268
220
-
## Outputs
221
-
Outputs vary depending on chosen comparison options. This is likely to change in near future. Below is the minimum common set of outputs.
222
-
```json
223
-
{
224
-
"command": "eval",
225
-
"result": {
226
-
"is_correct": "<bool>",
227
-
}
228
-
}
229
-
```
269
+
Note that in lists of groups the items should ideally be written on the form $q_1^{c_1} \cdot q_2^{c_2} \cdots q_n^{c_n}$ where $q_1, q_2 \ldots q_n$ are quantities and $c_1, c_2 \ldots c_n$ are integers, but the function can also handle item that are sums with terms written on the form $a \cdot q_1^{c_1} \cdot q_2^{c_2} \cdots q_n^{c_n}$ where $q_1, q_2 \ldots q_n$ are quantities, $c_1, c_2 \ldots c_n$ rational numbers and $a$ a constant. If the total number of groups is less than required the set of groups is considered invalid, even if there is a sufficient number of terms with independent power products in the response.
0 commit comments