Skip to content

Commit ce0ce9a

Browse files
committed
Add some examples for variable_content and console_output
1 parent c56f499 commit ce0ce9a

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

docs/console_output.md

+40
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,43 @@ an attempt will be made to convert to a float and apply a tolerance. This avoids
1414
e.g. `0`, `0.0` and `0.00000005` should all be considered the same.
1515

1616
This function is implemented in `checks/output_check.py`.
17+
18+
## Examples
19+
20+
|Response|Answer|Correct?|
21+
|--------|------|--------|
22+
|`print("Hello, World")`|`print("Hello, World!")`|No|
23+
|`print(0)`|`print(0.0)`|Yes|
24+
|```
25+
print(1)
26+
print(2)
27+
print(3)
28+
```
29+
|```
30+
for i in range(1, 4):
31+
print(i)
32+
```
33+
|Yes|
34+
35+
<table>
36+
<tr>
37+
<th>Response</th>
38+
<th>Answer</th>
39+
<th>Correct?</th>
40+
</tr>
41+
<tr>
42+
<td><code>print("Hello, World")</code></td>
43+
<td><code>print("Hello, World!")</code></td>
44+
<td>No</td>
45+
</tr>
46+
<tr>
47+
<td><code>print(0)</code></td>
48+
<td><code>print(0.0)</code></td>
49+
<td>Yes (if <code>output_inexact</code> is true)</td>
50+
</tr>
51+
<tr>
52+
<td><pre>print(1)<br>print(2)<br>print(3)<br></pre></td>
53+
<td><pre>for i in range(1, 4):<br> print(i)</pre></td>
54+
<td>Yes</td>
55+
</tr>
56+
</table>

docs/variable_content.md

+24
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,27 @@ can detect this, and still return a correct result. This facility is experimenta
2020
that any future developers consider improving this feature, and possibly gate it behind a parameter.
2121

2222
This checking function is implemented in `checks/global_variable_check.py`.
23+
24+
## Example
25+
26+
The response in this case will be marked correct.
27+
28+
Response:
29+
```python
30+
test1 = []
31+
for i in range(10)
32+
test1.append(i)
33+
34+
test2 = 10 + 32
35+
```
36+
Answer:
37+
```python
38+
test1 = [i for i in range(10)]
39+
test2 = 42
40+
```
41+
Params:
42+
```json
43+
{
44+
"global_variables_check_list": ["test1", "test2"]
45+
}
46+
```

0 commit comments

Comments
 (0)