<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>Parabola_1</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>The equation given below represents a parabola: \[ {@eq@}. \] <br /> Find the coordinates of the vertex, \((x_c,y_c)\), the coordinates of the focus, \((x_f,y_f)\) and the equation of the directrix.</p>
<p>Give your answer as a list containing (in this order) the coordinates of the vertex, the coordinates of the focus and the equation of the directrix.<br /> \( [ x_c, y_c, x_f, y_f, eq ] \) = [[input:ans1]] [[validation:ans1]]</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text><![CDATA[<p>If the equation can be written in the form \[ (y - y_c) = a\cdot(x-x_c)^2,\] then the vertex is given by \((x_c,y_c)\), the focus is given by \((x_c, y_c +\frac{1}{4a})\), and the directrix by \(y = y_c - \frac{1}{4a}\).</p>
<p><br /> Or, if it can be written in the form \[ (x - x_c) = a\cdot(y-y_c)^2,\] then the vertex is given by \((x_c,y_c)\), the focus is given by \((x_c + \frac{1}{4a}, y_c)\), and the directrix by \(x = x_c - \frac{1}{4a}\). <br /> <br /> The equation \({@eq@}\)    can be written as:</p>
<p>\[ {@aval@}{@factor(lhs(eq))@} = ({@rhseq@}) . \]</p>
<p>Giving, \(a = {@aval@}\), the coordinates of the vertex are  \(({@xc@},{@yc@})\), the coordinates of the focus are \(({@xf@},{@yf@})\) and the directrix is \({@dir@}\).</p>
<p> </p>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text/>
    </stackversion>
    <questionvariables>
      <text>form:rand(2)+1;
 xc:rand(7)+1;
 yc:-(rand(7)+1);
 a:(-1)^rand(2)*(rand(6)+2);
 eq: if form=1 then expand((y-yc)^2=4*a*(x-xc)) else expand((x-xc)^2=4*a*(y-yc));
 dir: if form=1 then x=xc-a else y=yc-a;
 xf: if form=1 then xc+a else xc;
 yf: if form=1 then yc else yc+a;
 aval:1/(4*a);
 
 rhseq:expand(rhs(eq)/(4*a));
 correctanswer:[xc,yc,xf,yf,dir];
 wrongvertexx:[xc-1,yc,xf,yf,dir];
 wrongvertexy:[xc,yc-1,xf,yf,dir];
 wrongfocusx:[xc,yc,xf-1,yf,dir];
 wrongfocusy:[xc,yc,xf,yf-1,dir];
 wrongdir:[xc,yc,xf,yf,z=5];</text>
    </questionvariables>
    <specificfeedback format="html">
      <text><![CDATA[<p>[[feedback:Result]]</p>]]></text>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>\({@eq@}, {@correctanswer@}\)</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>dot</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>algebraic</type>
      <tans>correctanswer</tans>
      <boxsize>15</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>1</requirelowestterms>
      <checkanswertype>1</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>1</showvalidation>
      <options/>
    </input>
    <prt>
      <name>Result</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>correctanswer</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>Result-0-T </trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>1</falsenextnode>
        <falseanswernote>Result-0-F </falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
      <node>
        <name>1</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans1[1]</sans>
        <tans>correctanswer[1]</tans>
        <testoptions/>
        <quiet>1</quiet>
        <truescoremode>+</truescoremode>
        <truescore>0.0000000</truescore>
        <truepenalty/>
        <truenextnode>2</truenextnode>
        <trueanswernote>Result-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>Result-1-F</falseanswernote>
        <falsefeedback format="html">
          <text><![CDATA[<p>Your x coordinate for the vertex is incorrect.</p>]]></text>
        </falsefeedback>
      </node>
      <node>
        <name>2</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans1[2]</sans>
        <tans>correctanswer[2]</tans>
        <testoptions/>
        <quiet>1</quiet>
        <truescoremode>+</truescoremode>
        <truescore>0.0000000</truescore>
        <truepenalty/>
        <truenextnode>3</truenextnode>
        <trueanswernote>Result-2-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>Result-2-F</falseanswernote>
        <falsefeedback format="html">
          <text><![CDATA[<p>Your y coordinate for the vertex is incorrect.</p>]]></text>
        </falsefeedback>
      </node>
      <node>
        <name>3</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans1[3]</sans>
        <tans>correctanswer[3]</tans>
        <testoptions/>
        <quiet>1</quiet>
        <truescoremode>+</truescoremode>
        <truescore>0.0000000</truescore>
        <truepenalty/>
        <truenextnode>4</truenextnode>
        <trueanswernote>Result-3-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>Result-3-F</falseanswernote>
        <falsefeedback format="html">
          <text><![CDATA[<p>Your x coordinate for the focus is incorrect.</p>]]></text>
        </falsefeedback>
      </node>
      <node>
        <name>4</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans1[4]</sans>
        <tans>correctanswer[4]</tans>
        <testoptions/>
        <quiet>1</quiet>
        <truescoremode>+</truescoremode>
        <truescore>0.0000000</truescore>
        <truepenalty/>
        <truenextnode>5</truenextnode>
        <trueanswernote>Result-4-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>Result-4-F</falseanswernote>
        <falsefeedback format="html">
          <text><![CDATA[<p>Your y coordinate for the focus is incorrect.</p>]]></text>
        </falsefeedback>
      </node>
      <node>
        <name>5</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans1[5]</sans>
        <tans>correctanswer[5]</tans>
        <testoptions/>
        <quiet>1</quiet>
        <truescoremode>+</truescoremode>
        <truescore>0.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>Result-5-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>Result-5-F</falseanswernote>
        <falsefeedback format="html">
          <text><![CDATA[<p>The directrix is incorrect.</p>]]></text>
        </falsefeedback>
      </node>
    </prt>
    <deployedseed>488895349</deployedseed>
    <deployedseed>37679064</deployedseed>
    <deployedseed>392313028</deployedseed>
    <deployedseed>2085458695</deployedseed>
    <deployedseed>446121744</deployedseed>
    <deployedseed>1711551960</deployedseed>
    <deployedseed>2123870745</deployedseed>
    <deployedseed>864063517</deployedseed>
    <deployedseed>1139849864</deployedseed>
    <deployedseed>1710973498</deployedseed>
    <deployedseed>624978558</deployedseed>
    <deployedseed>1139874580</deployedseed>
    <deployedseed>1002784492</deployedseed>
    <deployedseed>849177905</deployedseed>
    <deployedseed>1939867001</deployedseed>
    <deployedseed>1094061637</deployedseed>
    <deployedseed>1598177432</deployedseed>
    <deployedseed>1316858815</deployedseed>
    <deployedseed>1273810785</deployedseed>
    <deployedseed>517046765</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>correctanswer</value>
      </testinput>
      <expected>
        <name>Result</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>Result-0-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>wrongvertexx</value>
      </testinput>
      <expected>
        <name>Result</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>Result-1-F</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>3</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>wrongvertexy</value>
      </testinput>
      <expected>
        <name>Result</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>Result-2-F</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>4</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>wrongfocusx</value>
      </testinput>
      <expected>
        <name>Result</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>Result-3-F</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>5</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>wrongfocusy</value>
      </testinput>
      <expected>
        <name>Result</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>Result-4-F</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>6</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>wrongdir</value>
      </testinput>
      <expected>
        <name>Result</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>Result-5-F</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
