Skip to content

Commit d704417

Browse files
authored
Update NumericUnits.md
added guide for evaluation function parameters
1 parent 184a36f commit d704417

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

docs/teacher/reference/response_area_components/NumericUnits.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,34 @@
22

33
Provides two input fields with `Number` and `Units` placeholder texts. This area will also display its associated grading function (as seen in the screenshot below).
44

5-
**Note** this area will display how the user's response was interpred using the `interp_string` field provided in the feedback object returned by that function (if it exists).
5+
**Note:** this area will display how the user's response was interpred using the `interp_string` field provided in the feedback object returned by that function (if it exists).
66

77
## Component Parameters
8-
### `pre_response_text` (optional)
9-
Text block to be displayed to the left of the input field. Markdown and LaTeX are allowed following the usual syntax.
8+
### `pre_response_text` & `post_response_text` (optional)
9+
Text block to be displayed to the left and right of the input field respectively. Markdown and LaTeX are allowed following the usual syntax.
10+
### Comparing units
11+
By ticking the `physical_quantity (boolean)` option in the *Evaluate* tab, answers with different units from the reference answer can be compared.
12+
13+
![physical quantity ticked](screenshots/physical_quantity.png)
14+
15+
For example, if the reference answer is 100 m, the following answers will also be accepted:
16+
17+
* 0.1 km
18+
* 10000 cm
19+
* 10^5 mm
20+
### Tolerances
21+
Tolerances can be added to your answer using the `atol (number)` and `rtol (number)` fields, which denote absolute and relative tolerances respectively.
1022

1123
## Response Structure
1224
*This is how the react component will structure the user's input to the Grading Gateway, when they press the check button.*
1325

1426
In this case, the response is a single string which features the user's response to both fields separated by a space.
27+
1528
!!! example
1629

1730
```json
1831
"response": "150 g"
1932
```
2033

2134
## Example Screenshot
22-
![Screenshot](screenshots/NumericUnits.jpg)
35+
![Screenshot](screenshots/NumericUnits.jpg)

0 commit comments

Comments
 (0)