<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>17.1.1.13 Classifying conic sections</text>
    </name>
    <questiontext format="moodle_auto_format">
      <text><![CDATA[Classify each of the following conics as circle, ellipse, parabola or hyperbola:

<ol class="HELM_parts">
<li>{@poly[1]@} : [[input:ans1]] [[validation:ans1]][[feedback:prt1]]</li>
<li>{@poly[2]@} : [[input:ans2]] [[validation:ans2]][[feedback:prt2]]</li>
<li>{@poly[3]@} : [[input:ans3]] [[validation:ans3]][[feedback:prt3]]</li>
<li>{@poly[4]@} : [[input:ans4]] [[validation:ans4]][[feedback:prt4]]</li>
</ol>]]></text>
    </questiontext>
    <generalfeedback format="moodle_auto_format">
      <text><![CDATA[Recall that for a conic of the form
\[Ax^2+Bxy+Cy^2+Dx+Ey+F =0\]
<p>if not all of \(A,B,C\) are zero, the graph of the equation is:</p>
<ol type="i">
<li>an ellipse if \(B^2<4AC\) (circle if \(A = C\) and \(B=0\));</li>
<li>a parabola if \(B^2=4AC\);</li>
<li> an hyperbola if \(B^2>4AC\).</li>
</ol>
For our equations, calculating this we see:
<ol type="a">
<li>{@poly[1]@} is a {@first(mcq_correct(ta[1]))@} </li>
<li>{@poly[2]@} is a {@first(mcq_correct(ta[2]))@}</li>
<li>{@poly[3]@} is a {@first(mcq_correct(ta[3]))@} </li>
<li>{@poly[4]@} is a {@first(mcq_correct(ta[4]))@} </li>
</ol>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2025073100</text>
    </stackversion>
    <questionvariables>
      <text><![CDATA[ordergreat(x,y);
/*parabola*/
par:rand_selection(delete(0,makelist(i,i,-5,5)),5);
p2:sqrt(4*par[1]*par[1]);
polypar:par[1]*x^2+p2*x*y+par[1]*y^2+par[3]*x+par[4]*y+par[5];
MP:matrix([par[1],p2/2,par[3]/2],[p2/2,par[1],par[4]/2],[par[3]/2,par[4]/2,par[5]]);
/*while determinant(MP) =0 do (par[5]:par[5]+1);*/


/*hyperbola*/
hyp:rand_selection(delete(0,makelist(i,i,-5,5)),5);
h2:(-1)^(hyp[1])*(ceiling(sqrt(abs(4*hyp[1]*hyp[2])+2)));
polyhyp:hyp[1]*x^2+h2*x*y+hyp[2]*y^2+hyp[3]*x+hyp[4]*y+hyp[5];
MH:matrix([hyp[1],h2/2,hyp[3]/2],[h2/2,hyp[2],hyp[4]/2],[hyp[3]/2,hyp[4]/2,hyp[5]]);
while determinant(MH) =0 do (hyp[5]:hyp[5]+1);

/*ellipse */
ell:rand_selection(delete(0,makelist(i,i,-5,5)),3);
e1:1+rand(3);
e2:(-1)^(e1)*1;
polyell:e1*x^2+e2*x*y+e1*y^2+ell[1]*x+ell[2]*y+ell[3];
ME:matrix([e1,e2/2,ell[1]/2],[e2/2,e1,ell[2]/2],[ell[1]/2,ell[2]/2,ell[3]]);
while determinant(ME) =0 do (ell[5]:ell[5]+1);
/*circle*/
cir:rand_selection(delete(0,makelist(i,i,-5,5)),3);
c1:1+rand(3);
c2:0;
polycirc:c1*x^2+c2*x*y+c1*y^2+cir[1]*x+cir[2]*y+cir[3];
MC:matrix([c1,c2/2,cir[1]/2],[c2/2,c1,cir[2]/2],[cir[1]/2,cir[2]/2,cir[3]]);
while determinant(MC) =0 do (cir[5]:cir[5]+1);

perm:rand_selection([1,2,3,4],4);
conics:[polypar, polyhyp, polyell, polycirc];
poly:[1,2,3,4];
ta:[1,2,3,4];
mc:[[["Parabola",true],["Hyperbola",false],["Ellipse",false],["Circle",false]],[["Parabola",false],["Hyperbola",true],["Ellipse",false],["Circle",false]],[["Parabola",false],["Hyperbola",false],["Ellipse",true],["Circle",false]],[["Parabola",false],["Hyperbola",false],["Ellipse",false],["Circle",true]]];
for i:1 thru 4 do (poly[i]:conics[perm[i]]);
for i:1 thru 4 do(ta[i]:mc[perm[i]]);]]></text>
    </questionvariables>
    <specificfeedback format="html">
      <text/>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text><![CDATA[<li>{@poly[1]@} is a {@first(mcq_correct(ta[1]))@} </li>
<li>{@poly[2]@} is a {@first(mcq_correct(ta[2]))@}</li>
<li>{@poly[3]@} is a {@first(mcq_correct(ta[3]))@} </li>
<li>{@poly[4]@} is a {@first(mcq_correct(ta[4]))@} </li>]]></text>
    </questionnote>
    <questiondescription format="moodle_auto_format">
      <text/>
    </questiondescription>
    <questionsimplify>1</questionsimplify>
    <assumepositive>0</assumepositive>
    <assumereal>0</assumereal>
    <prtcorrect format="html">
      <text><![CDATA[<span style="font-size: 1.5em; color:green;"><i class="fa fa-check"></i></span> Correct answer, well done.]]></text>
    </prtcorrect>
    <prtpartiallycorrect format="html">
      <text><![CDATA[<span style="font-size: 1.5em; color:orange;"><i class="fa fa-adjust"></i></span> Your answer is partially correct.]]></text>
    </prtpartiallycorrect>
    <prtincorrect format="html">
      <text><![CDATA[<span style="font-size: 1.5em; color:red;"><i class="fa fa-times"></i></span> Incorrect answer.]]></text>
    </prtincorrect>
    <decimals>.</decimals>
    <scientificnotation>*10</scientificnotation>
    <multiplicationsign>onum</multiplicationsign>
    <sqrtsign>1</sqrtsign>
    <complexno>i</complexno>
    <inversetrig>cos-1</inversetrig>
    <logicsymbol>lang</logicsymbol>
    <matrixparens>[</matrixparens>
    <isbroken>0</isbroken>
    <variantsselectionseed/>
    <input>
      <name>ans1</name>
      <type>dropdown</type>
      <tans>ta[1]</tans>
      <boxsize>15</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>1</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans2</name>
      <type>dropdown</type>
      <tans>ta[2]</tans>
      <boxsize>15</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>1</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans3</name>
      <type>dropdown</type>
      <tans>ta[3]</tans>
      <boxsize>15</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>1</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans4</name>
      <type>dropdown</type>
      <tans>ta[4]</tans>
      <boxsize>15</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>1</showvalidation>
      <options/>
    </input>
    <prt>
      <name>prt1</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>[ans1]</sans>
        <tans>mcq_correct(ta[1])</tans>
        <testoptions/>
        <quiet>1</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt1-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt1-1-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <prt>
      <name>prt2</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>[ans2]</sans>
        <tans>mcq_correct(ta[2])</tans>
        <testoptions/>
        <quiet>1</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt2-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt2-1-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <prt>
      <name>prt3</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>[ans3]</sans>
        <tans>mcq_correct(ta[3])</tans>
        <testoptions/>
        <quiet>1</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt3-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt3-1-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <prt>
      <name>prt4</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>[ans4]</sans>
        <tans>mcq_correct(ta[4])</tans>
        <testoptions/>
        <quiet>1</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt4-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt4-1-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <deployedseed>1604051523</deployedseed>
    <deployedseed>2022452579</deployedseed>
    <deployedseed>2053493405</deployedseed>
    <deployedseed>1762899746</deployedseed>
    <deployedseed>30433072</deployedseed>
    <deployedseed>601997101</deployedseed>
    <deployedseed>321658055</deployedseed>
    <deployedseed>1214173743</deployedseed>
    <deployedseed>1124267603</deployedseed>
    <deployedseed>2113760092</deployedseed>
    <deployedseed>348184777</deployedseed>
    <deployedseed>805917031</deployedseed>
    <deployedseed>180702395</deployedseed>
    <deployedseed>539128953</deployedseed>
    <deployedseed>312857988</deployedseed>
    <deployedseed>88766279</deployedseed>
    <deployedseed>1167979766</deployedseed>
    <deployedseed>259952010</deployedseed>
    <deployedseed>1163636280</deployedseed>
    <deployedseed>1572915938</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>first(mcq_correct(ta[1]))</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>first(mcq_correct(ta[2]))</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>first(mcq_correct(ta[3]))</value>
      </testinput>
      <testinput>
        <name>ans4</name>
        <value>first(mcq_correct(ta[4]))</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt1-1-T</expectedanswernote>
      </expected>
      <expected>
        <name>prt2</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt2-1-T</expectedanswernote>
      </expected>
      <expected>
        <name>prt3</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt3-1-T</expectedanswernote>
      </expected>
      <expected>
        <name>prt4</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt4-1-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>first(mcq_incorrect(ta[1]))</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>first(mcq_incorrect(ta[2]))</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>first(mcq_incorrect(ta[3]))</value>
      </testinput>
      <testinput>
        <name>ans4</name>
        <value>first(mcq_incorrect(ta[4]))</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt1-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt2</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt2-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt3</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt3-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt4</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt4-1-F</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
