Skip to content

Commit a14f303

Browse files
committed
Fix to issue #1715 (question library).
1 parent 7042a62 commit a14f303

4 files changed

Lines changed: 136 additions & 108 deletions

File tree

Lines changed: 93 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<quiz>
3+
<!-- question: 945 -->
34
<question type="stack">
45
<name>
56
<text>AlgMap-3.1</text>
67
</name>
78
<questiontext format="html">
8-
<text><![CDATA[<p>Express the following, as a single fraction: \[{@a/b@}+{@c/d@}.\] <br /> [[input:ans]] <br /> <br /> Leave your answer in it's lowest terms in the form \(\frac{a}{b}\). [[validation:ans]]</p>]]></text>
9+
<text><![CDATA[<p>Express the following, as a single fraction: \[{@a/b@}+{@c/d@}.\] </p>
10+
<p>[[input:ans]] [[validation:ans]]</p>
11+
Leave your answer in it's lowest terms in the form \(\frac{a}{b}\). </p>]]></text>
912
</questiontext>
1013
<generalfeedback format="html">
11-
<text><![CDATA[<p>In this case the denominators of the fractions are equal so you simply add the numerators to obtain the numerator and the denominator stays the same.</p>
14+
<text><![CDATA[<p>In this case the denominators of the fractions are equal so you simply add the numerators to obtain the numerator and the denominator stays the same.</p>
1215
<p>The general rule is: \[\frac{a}{b} + \frac{c}{b} = \frac{a+c}{b} \] In this exmaple: \[{@a/b@}+{@c/d@} = \frac{{@a@}+{@c@}}{@b@} = {@ta@}.\]</p>]]></text>
1316
</generalfeedback>
1417
<defaultgrade>1</defaultgrade>
1518
<penalty>0.1</penalty>
1619
<hidden>0</hidden>
17-
<idnumber/>
20+
<idnumber></idnumber>
1821
<stackversion>
19-
<text/>
22+
<text>2026010500</text>
2023
</stackversion>
2124
<questionvariables>
22-
<text>simp:true;
23-
b:rand(5)+3;
24-
a:b-1;
25-
d:b;
26-
c:d+1;
27-
ta:(a/b)+(c/d);
28-
lcm:lcm(b,d);
25+
<text>simp:true;
26+
b:rand(5)+3;
27+
a:b-1;
28+
d:b;
29+
c:d+1;
30+
ta:(a/b)+(c/d);
31+
lcm:lcm(b,d);
2932
simp:false;</text>
3033
</questionvariables>
3134
<specificfeedback format="html">
@@ -35,7 +38,7 @@ simp:false;</text>
3538
<text>\[{@a/b@}+{@c/d@} = {@ta@}.\]</text>
3639
</questionnote>
3740
<questiondescription format="moodle_auto_format">
38-
<text/>
41+
<text></text>
3942
</questiondescription>
4043
<questionsimplify>0</questionsimplify>
4144
<assumepositive>0</assumepositive>
@@ -58,106 +61,106 @@ simp:false;</text>
5861
<logicsymbol>lang</logicsymbol>
5962
<matrixparens>[</matrixparens>
6063
<isbroken>0</isbroken>
61-
<variantsselectionseed/>
64+
<variantsselectionseed></variantsselectionseed>
6265
<input>
6366
<name>ans</name>
6467
<type>algebraic</type>
6568
<tans>ta</tans>
6669
<boxsize>15</boxsize>
6770
<strictsyntax>1</strictsyntax>
6871
<insertstars>0</insertstars>
69-
<syntaxhint/>
72+
<syntaxhint></syntaxhint>
7073
<syntaxattribute>0</syntaxattribute>
71-
<forbidwords/>
72-
<allowwords/>
74+
<forbidwords></forbidwords>
75+
<allowwords></allowwords>
7376
<forbidfloat>1</forbidfloat>
7477
<requirelowestterms>0</requirelowestterms>
7578
<checkanswertype>1</checkanswertype>
7679
<mustverify>1</mustverify>
7780
<showvalidation>1</showvalidation>
78-
<options/>
81+
<options></options>
7982
</input>
8083
<prt>
8184
<name>prt1</name>
8285
<value>1.0000000</value>
8386
<autosimplify>0</autosimplify>
8487
<feedbackstyle>1</feedbackstyle>
8588
<feedbackvariables>
86-
<text/>
89+
<text></text>
8790
</feedbackvariables>
8891
<node>
8992
<name>0</name>
90-
<description/>
91-
<answertest>EqualComAss</answertest>
93+
<description>Correct answers</description>
94+
<answertest>EqualComAssRules</answertest>
9295
<sans>ans</sans>
9396
<tans>ta</tans>
94-
<testoptions/>
97+
<testoptions>[ID_TRANS]</testoptions>
9598
<quiet>0</quiet>
9699
<truescoremode>=</truescoremode>
97-
<truescore>1.0000000</truescore>
98-
<truepenalty/>
100+
<truescore>1</truescore>
101+
<truepenalty></truepenalty>
99102
<truenextnode>-1</truenextnode>
100-
<trueanswernote>1-0-T </trueanswernote>
103+
<trueanswernote>prt1-1-T</trueanswernote>
101104
<truefeedback format="html">
102-
<text/>
105+
<text></text>
103106
</truefeedback>
104107
<falsescoremode>=</falsescoremode>
105-
<falsescore>0.0000000</falsescore>
106-
<falsepenalty/>
107-
<falsenextnode>2</falsenextnode>
108-
<falseanswernote>1-0-F </falseanswernote>
108+
<falsescore>0</falsescore>
109+
<falsepenalty></falsepenalty>
110+
<falsenextnode>1</falsenextnode>
111+
<falseanswernote>prt1-1-F</falseanswernote>
109112
<falsefeedback format="html">
110-
<text/>
113+
<text></text>
111114
</falsefeedback>
112115
</node>
113116
<node>
114117
<name>1</name>
115-
<description/>
118+
<description></description>
116119
<answertest>AlgEquiv</answertest>
117120
<sans>ans</sans>
118-
<tans>(a+c)/(b+d)</tans>
119-
<testoptions/>
121+
<tans>ta</tans>
122+
<testoptions></testoptions>
120123
<quiet>0</quiet>
121124
<truescoremode>=</truescoremode>
122-
<truescore>0.0000000</truescore>
123-
<truepenalty/>
125+
<truescore>0</truescore>
126+
<truepenalty></truepenalty>
124127
<truenextnode>-1</truenextnode>
125-
<trueanswernote>1-1-T (naive adding of fractions)</trueanswernote>
128+
<trueanswernote>prt1-2-T</trueanswernote>
126129
<truefeedback format="html">
127-
<text><![CDATA[<p>Remember that the first step in adding fractions is to make both denominators equal. It is not simply adding the numerators and the denominators.</p>]]></text>
130+
<text><![CDATA[<p>Simplify the fraction fully into the form \(\frac{a}{b}\) and leave in it's lowest terms.</p>]]></text>
128131
</truefeedback>
129132
<falsescoremode>=</falsescoremode>
130-
<falsescore>0.0000000</falsescore>
131-
<falsepenalty/>
132-
<falsenextnode>-1</falsenextnode>
133-
<falseanswernote>1-1-F </falseanswernote>
133+
<falsescore>0</falsescore>
134+
<falsepenalty></falsepenalty>
135+
<falsenextnode>2</falsenextnode>
136+
<falseanswernote>prt1-2-F</falseanswernote>
134137
<falsefeedback format="html">
135-
<text/>
138+
<text></text>
136139
</falsefeedback>
137140
</node>
138141
<node>
139142
<name>2</name>
140-
<description/>
143+
<description>Naive adding of fractions/mediant</description>
141144
<answertest>AlgEquiv</answertest>
142145
<sans>ans</sans>
143-
<tans>ta</tans>
144-
<testoptions/>
146+
<tans>(a+c)/(b+d)</tans>
147+
<testoptions></testoptions>
145148
<quiet>0</quiet>
146149
<truescoremode>=</truescoremode>
147-
<truescore>0.0000000</truescore>
148-
<truepenalty/>
150+
<truescore>0</truescore>
151+
<truepenalty></truepenalty>
149152
<truenextnode>-1</truenextnode>
150-
<trueanswernote>1-2-T </trueanswernote>
153+
<trueanswernote>prt1-3-T</trueanswernote>
151154
<truefeedback format="html">
152-
<text><![CDATA[<p>Simplify the fraction fully into the form \(\frac{a}{b}\) and leave in it's lowest terms.</p>]]></text>
155+
<text><![CDATA[<p>Remember that the first step in adding fractions is to make both denominators equal. It is not simply adding the numerators and the denominators.</p>]]></text>
153156
</truefeedback>
154157
<falsescoremode>=</falsescoremode>
155-
<falsescore>0.0000000</falsescore>
156-
<falsepenalty/>
157-
<falsenextnode>1</falsenextnode>
158-
<falseanswernote>1-2-F </falseanswernote>
158+
<falsescore>0</falsescore>
159+
<falsepenalty></falsepenalty>
160+
<falsenextnode>-1</falsenextnode>
161+
<falseanswernote>prt1-3-F</falseanswernote>
159162
<falsefeedback format="html">
160-
<text/>
163+
<text></text>
161164
</falsefeedback>
162165
</node>
163166
</prt>
@@ -168,7 +171,7 @@ simp:false;</text>
168171
<deployedseed>944404612</deployedseed>
169172
<qtest>
170173
<testcase>1</testcase>
171-
<description/>
174+
<description></description>
172175
<testinput>
173176
<name>ans</name>
174177
<value>ta</value>
@@ -177,12 +180,12 @@ simp:false;</text>
177180
<name>prt1</name>
178181
<expectedscore>1.0000000</expectedscore>
179182
<expectedpenalty>0.0000000</expectedpenalty>
180-
<expectedanswernote>1-0-T</expectedanswernote>
183+
<expectedanswernote>prt1-1-T</expectedanswernote>
181184
</expected>
182185
</qtest>
183186
<qtest>
184187
<testcase>2</testcase>
185-
<description/>
188+
<description></description>
186189
<testinput>
187190
<name>ans</name>
188191
<value>(a+c)/(b+d)</value>
@@ -191,12 +194,12 @@ simp:false;</text>
191194
<name>prt1</name>
192195
<expectedscore>0.0000000</expectedscore>
193196
<expectedpenalty>0.1000000</expectedpenalty>
194-
<expectedanswernote>1-1-T (naive adding of fractions)</expectedanswernote>
197+
<expectedanswernote>prt1-3-T</expectedanswernote>
195198
</expected>
196199
</qtest>
197200
<qtest>
198201
<testcase>3</testcase>
199-
<description/>
202+
<description></description>
200203
<testinput>
201204
<name>ans</name>
202205
<value>a/b+c/d</value>
@@ -205,8 +208,37 @@ simp:false;</text>
205208
<name>prt1</name>
206209
<expectedscore>0.0000000</expectedscore>
207210
<expectedpenalty>0.1000000</expectedpenalty>
208-
<expectedanswernote>1-2-T</expectedanswernote>
211+
<expectedanswernote>prt1-2-T</expectedanswernote>
212+
</expected>
213+
</qtest>
214+
<qtest>
215+
<testcase>4</testcase>
216+
<description>Literal a/b</description>
217+
<testinput>
218+
<name>ans</name>
219+
<value>2/1</value>
220+
</testinput>
221+
<expected>
222+
<name>prt1</name>
223+
<expectedscore>1.0000000</expectedscore>
224+
<expectedpenalty>0.0000000</expectedpenalty>
225+
<expectedanswernote>prt1-1-T</expectedanswernote>
226+
</expected>
227+
</qtest>
228+
<qtest>
229+
<testcase>5</testcase>
230+
<description>Wrong answer</description>
231+
<testinput>
232+
<name>ans</name>
233+
<value>3/2</value>
234+
</testinput>
235+
<expected>
236+
<name>prt1</name>
237+
<expectedscore>0.0000000</expectedscore>
238+
<expectedpenalty></expectedpenalty>
239+
<expectedanswernote>prt1-3-F</expectedanswernote>
209240
</expected>
210241
</qtest>
211242
</question>
212-
</quiz>
243+
244+
</quiz>

0 commit comments

Comments
 (0)