Skip to content

Commit

Permalink
Minor changes to phrases, and update the auto-generated docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
sangwinc committed Feb 10, 2025
1 parent d978aa7 commit 681d8a4
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 100 deletions.
210 changes: 117 additions & 93 deletions doc/en/Authoring/Answer_Tests/Results/AddConst.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,75 @@ This page exposes the results of running answer tests on STACK test cases. This
<td class="cell c0"><td colspan="2"></td></td>
<td class="cell c1"><td colspan="4">The answer test failed to execute correctly: please alert your teacher. Missing option when executing the test. </td></td>
</tr>
<tr class="expectedfail">
<td class="cell c0">AddConst</td>
<td class="cell c1"><span style="color:orange;"><i class="fa fa-adjust"></i></span></td>
<td class="cell c2"><pre>x^3/3</pre></td>
<td class="cell c3"><pre>x^3/3</pre></td>
<td class="cell c4"></td>
<td class="cell c5">-1</td>
<td class="cell c6">STACKERROR_OPTION.</td>
</tr>
<tr class="expectedfail">
<td class="cell c0"><td colspan="2"></td></td>
<td class="cell c1"><td colspan="4">TEST_FAILED</td></td>
</tr>
<tr class="expectedfail">
<td class="cell c0"><td colspan="2"></td></td>
<td class="cell c1"><td colspan="4">The answer test failed to execute correctly: please alert your teacher. Missing option when executing the test. </td></td>
</tr>
<tr class="expectedfail">
<td class="cell c0">AddConst</td>
<td class="cell c1"><span style="color:orange;"><i class="fa fa-adjust"></i></span></td>
<td class="cell c2"><pre>x^3/3</pre></td>
<td class="cell c3"><pre>x^3/3</pre></td>
<td class="cell c4"><pre>[[x]]</pre></td>
<td class="cell c5">-1</td>
<td class="cell c6">ATAddConst_Opt.</td>
</tr>
<tr class="expectedfail">
<td class="cell c0"><td colspan="2"></td></td>
<td class="cell c1"><td colspan="4">The answer test failed to execute correctly: please alert your teacher. There is something wrong with the options given to the AddConst answer test.</td></td>
</tr>
<tr class="expectedfail">
<td class="cell c0">AddConst</td>
<td class="cell c1"><span style="color:orange;"><i class="fa fa-adjust"></i></span></td>
<td class="cell c2"><pre>x^3/3</pre></td>
<td class="cell c3"><pre>x^3/3</pre></td>
<td class="cell c4"><pre>x^2</pre></td>
<td class="cell c5">-1</td>
<td class="cell c6">ATAddConst_Opt.</td>
</tr>
<tr class="expectedfail">
<td class="cell c0"><td colspan="2"></td></td>
<td class="cell c1"><td colspan="4">The answer test failed to execute correctly: please alert your teacher. There is something wrong with the options given to the AddConst answer test.</td></td>
</tr>
<tr class="expectedfail">
<td class="cell c0">AddConst</td>
<td class="cell c1"><span style="color:orange;"><i class="fa fa-adjust"></i></span></td>
<td class="cell c2"><pre>x^3/3</pre></td>
<td class="cell c3"><pre>x^3/3</pre></td>
<td class="cell c4"><pre>x^3/3</pre></td>
<td class="cell c5">-1</td>
<td class="cell c6">ATAddConst_Opt.</td>
</tr>
<tr class="expectedfail">
<td class="cell c0"><td colspan="2"></td></td>
<td class="cell c1"><td colspan="4">The answer test failed to execute correctly: please alert your teacher. There is something wrong with the options given to the AddConst answer test.</td></td>
</tr>
<tr class="expectedfail">
<td class="cell c0">AddConst</td>
<td class="cell c1"><span style="color:orange;"><i class="fa fa-adjust"></i></span></td>
<td class="cell c2"><pre>x^3/3</pre></td>
<td class="cell c3"><pre>x^3/3</pre></td>
<td class="cell c4"><pre>0</pre></td>
<td class="cell c5">-1</td>
<td class="cell c6">ATAddConst_Opt.</td>
</tr>
<tr class="expectedfail">
<td class="cell c0"><td colspan="2"></td></td>
<td class="cell c1"><td colspan="4">The answer test failed to execute correctly: please alert your teacher. There is something wrong with the options given to the AddConst answer test.</td></td>
</tr>
<tr class="expectedfail">
<td class="cell c0">AddConst</td>
<td class="cell c1"><span style="color:orange;"><i class="fa fa-adjust"></i></span></td>
Expand Down Expand Up @@ -88,36 +157,6 @@ This page exposes the results of running answer tests on STACK test cases. This
<td class="cell c0"><td colspan="2"></td></td>
<td class="cell c1"><td colspan="4">You need to add a constant. This should be an arbitrary constant, not a number.</td></td>
</tr>
<tr class="expectedfail">
<td class="cell c0">AddConst</td>
<td class="cell c1"><span style="color:orange;"><i class="fa fa-adjust"></i></span></td>
<td class="cell c2"><pre>x^3/3</pre></td>
<td class="cell c3"><pre>x^3/3</pre></td>
<td class="cell c4"></td>
<td class="cell c5">-1</td>
<td class="cell c6">STACKERROR_OPTION.</td>
</tr>
<tr class="expectedfail">
<td class="cell c0"><td colspan="2"></td></td>
<td class="cell c1"><td colspan="4">TEST_FAILED</td></td>
</tr>
<tr class="expectedfail">
<td class="cell c0"><td colspan="2"></td></td>
<td class="cell c1"><td colspan="4">The answer test failed to execute correctly: please alert your teacher. Missing option when executing the test. </td></td>
</tr>
<tr class="expectedfail">
<td class="cell c0">AddConst</td>
<td class="cell c1"><span style="color:orange;"><i class="fa fa-adjust"></i></span></td>
<td class="cell c2"><pre>x^3/3</pre></td>
<td class="cell c3"><pre>x^3/3</pre></td>
<td class="cell c4"><pre>0</pre></td>
<td class="cell c5">-1</td>
<td class="cell c6">ATAddConst_Opt.</td>
</tr>
<tr class="expectedfail">
<td class="cell c0"><td colspan="2"></td></td>
<td class="cell c1"><td colspan="4">The answer test failed to execute correctly: please alert your teacher. There is something wrong with the options given to the AddConst answer test.</td></td>
</tr>
<tr class="pass">
<td class="cell c0">AddConst</td>
<td class="cell c1"><span style="color:green;"><i class="fa fa-check"></i></span></td>
Expand All @@ -131,45 +170,6 @@ This page exposes the results of running answer tests on STACK test cases. This
<td class="cell c0"><td colspan="2"></td></td>
<td class="cell c1"><td colspan="4">You included an additional constant, but you didn't simply add it!</td></td>
</tr>
<tr class="expectedfail">
<td class="cell c0">AddConst</td>
<td class="cell c1"><span style="color:orange;"><i class="fa fa-adjust"></i></span></td>
<td class="cell c2"><pre>x^3/3</pre></td>
<td class="cell c3"><pre>x^3/3</pre></td>
<td class="cell c4"><pre>[[x]]</pre></td>
<td class="cell c5">-1</td>
<td class="cell c6">ATAddConst_Opt.</td>
</tr>
<tr class="expectedfail">
<td class="cell c0"><td colspan="2"></td></td>
<td class="cell c1"><td colspan="4">The answer test failed to execute correctly: please alert your teacher. There is something wrong with the options given to the AddConst answer test.</td></td>
</tr>
<tr class="expectedfail">
<td class="cell c0">AddConst</td>
<td class="cell c1"><span style="color:orange;"><i class="fa fa-adjust"></i></span></td>
<td class="cell c2"><pre>x^3/3</pre></td>
<td class="cell c3"><pre>x^3/3</pre></td>
<td class="cell c4"><pre>x^2</pre></td>
<td class="cell c5">-1</td>
<td class="cell c6">ATAddConst_Opt.</td>
</tr>
<tr class="expectedfail">
<td class="cell c0"><td colspan="2"></td></td>
<td class="cell c1"><td colspan="4">The answer test failed to execute correctly: please alert your teacher. There is something wrong with the options given to the AddConst answer test.</td></td>
</tr>
<tr class="expectedfail">
<td class="cell c0">AddConst</td>
<td class="cell c1"><span style="color:orange;"><i class="fa fa-adjust"></i></span></td>
<td class="cell c2"><pre>x^3/3</pre></td>
<td class="cell c3"><pre>x^3/3</pre></td>
<td class="cell c4"><pre>x^3/3</pre></td>
<td class="cell c5">-1</td>
<td class="cell c6">ATAddConst_Opt.</td>
</tr>
<tr class="expectedfail">
<td class="cell c0"><td colspan="2"></td></td>
<td class="cell c1"><td colspan="4">The answer test failed to execute correctly: please alert your teacher. There is something wrong with the options given to the AddConst answer test.</td></td>
</tr>
<tr class="pass">
<td class="cell c0">AddConst</td>
<td class="cell c1"><span style="color:green;"><i class="fa fa-check"></i></span></td>
Expand Down Expand Up @@ -843,23 +843,31 @@ This page exposes the results of running answer tests on STACK test cases. This
<td class="cell c5">1</td>
<td class="cell c6">ATAddConst_true.</td>
</tr>
<tr class="pass">
<tr class="fail">
<td class="cell c0">AddConst</td>
<td class="cell c1"><span style="color:green;"><i class="fa fa-check"></i></span></td>
<td class="cell c1"><span style="color:red;"><i class="fa fa-times"></i></span></td>
<td class="cell c2"><pre>(x^3+c)/3</pre></td>
<td class="cell c3"><pre>x^3/3</pre></td>
<td class="cell c4"><pre>[x, NONSTRICT]</pre></td>
<td class="cell c5">1</td>
<td class="cell c6">ATAddConst_true.</td>
<td class="cell c5">0 <> 1</td>
<td class="cell c6">ATAddConst_generic.<pre>ATAddConst((x^3+c)/3, x^3/3, [x,NONSTRICT]);</pre></td>
</tr>
<tr class="pass">
<tr class="fail">
<td class="cell c0"><td colspan="2"></td></td>
<td class="cell c1"><td colspan="4">You included an additional constant, but you didn't simply add it!</td></td>
</tr>
<tr class="fail">
<td class="cell c0">AddConst</td>
<td class="cell c1"><span style="color:green;"><i class="fa fa-check"></i></span></td>
<td class="cell c1"><span style="color:red;"><i class="fa fa-times"></i></span></td>
<td class="cell c2"><pre>(x^3+c)/3</pre></td>
<td class="cell c3"><pre>x^3/3</pre></td>
<td class="cell c4"><pre>[NONSTRICT, x]</pre></td>
<td class="cell c5">1</td>
<td class="cell c6">ATAddConst_true.</td>
<td class="cell c5">0 <> 1</td>
<td class="cell c6">ATAddConst_generic.<pre>ATAddConst((x^3+c)/3, x^3/3, [NONSTRICT,x]);</pre></td>
</tr>
<tr class="fail">
<td class="cell c0"><td colspan="2"></td></td>
<td class="cell c1"><td colspan="4">You included an additional constant, but you didn't simply add it!</td></td>
</tr>
<tr class="pass">
<td class="cell c0">AddConst</td>
Expand Down Expand Up @@ -944,23 +952,31 @@ This page exposes the results of running answer tests on STACK test cases. This
<td class="cell c0"><td colspan="2"></td></td>
<td class="cell c1"><td colspan="4">You included an additional constant, but you didn't simply add it!</td></td>
</tr>
<tr class="pass">
<tr class="fail">
<td class="cell c0">AddConst</td>
<td class="cell c1"><span style="color:green;"><i class="fa fa-check"></i></span></td>
<td class="cell c1"><span style="color:red;"><i class="fa fa-times"></i></span></td>
<td class="cell c2"><pre>ln(k*abs(x))</pre></td>
<td class="cell c3"><pre>ln(abs(x))+c</pre></td>
<td class="cell c4"><pre>[x, NONSTRICT]</pre></td>
<td class="cell c5">1</td>
<td class="cell c6">ATAddConst_true.</td>
<td class="cell c5">0 <> 1</td>
<td class="cell c6">ATAddConst_generic.<pre>ATAddConst(ln(k*abs(x)), ln(abs(x))+c, [x,NONSTRICT]);</pre></td>
</tr>
<tr class="pass">
<tr class="fail">
<td class="cell c0"><td colspan="2"></td></td>
<td class="cell c1"><td colspan="4">You included an additional constant, but you didn't simply add it!</td></td>
</tr>
<tr class="fail">
<td class="cell c0">AddConst</td>
<td class="cell c1"><span style="color:green;"><i class="fa fa-check"></i></span></td>
<td class="cell c1"><span style="color:red;"><i class="fa fa-times"></i></span></td>
<td class="cell c2"><pre>ln(abs(k*x))</pre></td>
<td class="cell c3"><pre>ln(abs(x))+c</pre></td>
<td class="cell c4"><pre>[x, NONSTRICT]</pre></td>
<td class="cell c5">1</td>
<td class="cell c6">ATAddConst_true.</td>
<td class="cell c5">0 <> 1</td>
<td class="cell c6">ATAddConst_generic.<pre>ATAddConst(ln(abs(k*x)), ln(abs(x))+c, [x,NONSTRICT]);</pre></td>
</tr>
<tr class="fail">
<td class="cell c0"><td colspan="2"></td></td>
<td class="cell c1"><td colspan="4">You included an additional constant, but you didn't simply add it!</td></td>
</tr>
<tr class="pass">
<td class="cell c0">AddConst</td>
Expand All @@ -971,23 +987,31 @@ This page exposes the results of running answer tests on STACK test cases. This
<td class="cell c5">1</td>
<td class="cell c6">ATAddConst_true.</td>
</tr>
<tr class="pass">
<tr class="fail">
<td class="cell c0">AddConst</td>
<td class="cell c1"><span style="color:green;"><i class="fa fa-check"></i></span></td>
<td class="cell c1"><span style="color:red;"><i class="fa fa-times"></i></span></td>
<td class="cell c2"><pre>ln(k*abs(x))</pre></td>
<td class="cell c3"><pre>ln(abs(x))+c</pre></td>
<td class="cell c4"><pre>[NONSTRICT, x]</pre></td>
<td class="cell c5">1</td>
<td class="cell c6">ATAddConst_true.</td>
<td class="cell c5">0 <> 1</td>
<td class="cell c6">ATAddConst_generic.<pre>ATAddConst(ln(k*abs(x)), ln(abs(x))+c, [NONSTRICT,x]);</pre></td>
</tr>
<tr class="pass">
<tr class="fail">
<td class="cell c0"><td colspan="2"></td></td>
<td class="cell c1"><td colspan="4">You included an additional constant, but you didn't simply add it!</td></td>
</tr>
<tr class="fail">
<td class="cell c0">AddConst</td>
<td class="cell c1"><span style="color:green;"><i class="fa fa-check"></i></span></td>
<td class="cell c1"><span style="color:red;"><i class="fa fa-times"></i></span></td>
<td class="cell c2"><pre>ln(abs(k*x))</pre></td>
<td class="cell c3"><pre>ln(abs(x))+c</pre></td>
<td class="cell c4"><pre>[NONSTRICT, x]</pre></td>
<td class="cell c5">1</td>
<td class="cell c6">ATAddConst_true.</td>
<td class="cell c5">0 <> 1</td>
<td class="cell c6">ATAddConst_generic.<pre>ATAddConst(ln(abs(k*x)), ln(abs(x))+c, [NONSTRICT,x]);</pre></td>
</tr>
<tr class="fail">
<td class="cell c0"><td colspan="2"></td></td>
<td class="cell c1"><td colspan="4">You included an additional constant, but you didn't simply add it!</td></td>
</tr>
<tr class="pass">
<td class="cell c0">AddConst</td>
Expand Down
2 changes: 1 addition & 1 deletion lang/en/qtype_stack.php
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,7 @@
$string['ATAddConst_true'] = '';
$string['ATAddConst_Opt'] = 'The answer test failed to execute correctly: please alert your teacher. There is something wrong with the options given to the AddConst answer test.';;
$string['ATAddConst_noconst'] = 'You need to add a constant. This should be an arbitrary constant, not a number.';
$string['ATAddConst_severalconst'] = 'You used several additional constants have been found instead of just one!';
$string['ATAddConst_severalconst'] = 'Several additional constants have been found instead of just one constant of integration!';
$string['ATAddConst_generic'] = 'You included an additional constant, but you didn\'t simply add it!';

$string['ATDiff_error_list'] = 'The answer test failed. Please contact your systems administrator';
Expand Down
6 changes: 6 additions & 0 deletions tests/answertest_general_cas_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -730,4 +730,10 @@ public function test_is_true_for_nearly_equal_strings_sloppy(): void {
$this->assertTrue($at->do_test());
$this->assertEquals(1, $at->get_at_mark());
}

public function test_is_true_at_antidiff(): void {
$at = $this->stack_answertest_general_cas_builder('x^3/3+c', 'x^3/3', 'Antidiff', 'x');
$this->assertTrue($at->do_test());
$this->assertEquals(1, $at->get_at_mark());
}
}
2 changes: 1 addition & 1 deletion tests/cassession2_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ public function test_zip_with_matrix(): void {
$this->assertEquals('matrix([false,false],[false,true])', $s1[3]->get_value());
}

public function test_zip_with_matrix_AT(): void {
public function test_zip_with_matrix_at(): void {
$cs = ['M1:matrix([3.1415,10.0])', 'M2:matrix([%pi,%pi^2])'];
$cs[] = 'M:matrixmap(second,zip_with_matrix(lambda([ex1,ex2], ATNumAbsolute(ex1,ex2,0.01)), M1, M2))';
foreach ($cs as $s) {
Expand Down
10 changes: 5 additions & 5 deletions tests/fixtures/answertestfixtures.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2197,18 +2197,18 @@ class stack_answertest_test_data {


['AddConst', '', '1/0', '1', -1, 'STACKERROR_OPTION.', ''],
['AddConst', '', 'x^3/3', 'x^3/3', -1, 'STACKERROR_OPTION.', ''],
['AddConst', '[[x]]', 'x^3/3', 'x^3/3', -1, 'ATAddConst_Opt.', ''],
['AddConst', 'x^2', 'x^3/3', 'x^3/3', -1, 'ATAddConst_Opt.', ''],
['AddConst', 'x^3/3', 'x^3/3', 'x^3/3', -1, 'ATAddConst_Opt.', ''],
['AddConst', '0', 'x^3/3', 'x^3/3', -1, 'ATAddConst_Opt.', ''],
['AddConst', 'x', '1/0', '1', -1, 'ATAddConst_STACKERROR_SAns.', ''],
['AddConst', '1/0', '0', '0', -1, 'ATAddConst_STACKERROR_Opt.', ''],
['AddConst', '[x,1/0]', '0', '0', -1, 'ATAddConst_STACKERROR_Opt.', ''],
['AddConst', '[x,NOCONST,1/0]', '0', '0', -1, 'ATAddConst_STACKERROR_Opt.', ''],
['AddConst', 'x', 'x^3/3', 'x^3/3', 0, 'ATAddConst_noconst.', 'Basic tests'],
['AddConst', '[x]', 'x^3/3', 'x^3/3', 0, 'ATAddConst_noconst.', ''],
['AddConst', '', 'x^3/3', 'x^3/3', -1, 'STACKERROR_OPTION.', ''],
['AddConst', '0', 'x^3/3', 'x^3/3', -1, 'ATAddConst_Opt.', ''],
['AddConst', 'aaa', 'x^3/3', 'x^3/3', 0, 'ATAddConst_generic.', ''],
['AddConst', '[[x]]', 'x^3/3', 'x^3/3', -1, 'ATAddConst_Opt.', ''],
['AddConst', 'x^2', 'x^3/3', 'x^3/3', -1, 'ATAddConst_Opt.', ''],
['AddConst', 'x^3/3', 'x^3/3', 'x^3/3', -1, 'ATAddConst_Opt.', ''],
['AddConst', 'x', 'x^3/3+1', 'x^3/3', 0, 'ATAddConst_noconst.', ''],
['AddConst', 'x', 'x^3/3+c', 'x^3/3', 1, 'ATAddConst_true.', ''],
['AddConst', 'x', 'x^3/3-c', 'x^3/3', 0, 'ATAddConst_generic.', ''],
Expand Down

0 comments on commit 681d8a4

Please sign in to comment.