<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>AlgMap-15.1</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[Solve the following quadratic equation by factorising:
\[ {@expand((cf1*v+a)*(cf2*v+b))@} = 0. \]  <br>
<br>
Write this quadratic in factored form: [[input:ansf]]\(=0\). [[validation:ansf]]
[[feedback:fac]]
<br>
<br>
Solve this equation, giving your answer as a set \(\left(\mbox{e.g. }\left\{x_1 , x_2\right\}\right)\): <br>
<br>
\({@v@} \in \) [[input:ans]] [[validation:ans]][[feedback:prt1]]]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text><![CDATA[There are multiple ways of solving quadratic equations but if you can spot how to factorise the quadratic then this method is by far the fastest and simplest. In this example we can factorise the quadratic to give: 
\[ {@(cf1*v+a)*(cf2*v+b)@} = 0. \]
Now, notice, that for the above equation to be equal to zero, the factors must be made to equal zero. So we find that:
\[ {@cf1*v+a@} = 0, \]
or:
\[ {@cf2*v+b@} = 0. \] 
By rearranging these expressions we find that:
<br>
\({@v@} = {@ta1@}\) or \({@v@} = {@ta2@}\). Therefore our solution set is:
\[ {@v@} \in \left\{ {@ta1@} , {@ta2@} \right\}. \]]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text/>
    </stackversion>
    <questionvariables>
      <text>v:rand([x,y,z,t]);
cf1:rand(5)+1;
cf2:rand(5)+1;
a:rand(6)*rand([-1,1]);
b:(rand(6)+1)*rand([-1,1]);
ta1:-a/cf1;
ta2:-b/cf2;</text>
    </questionvariables>
    <specificfeedback format="html">
      <text/>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>\[ {@expand((cf1*v+a)*(cf2*v+b))@} = {@((cf1*v+a)*(cf2*v+b))@} = 0. \] 
\[ {@v@} \in \left\{ {@ta1@} , {@ta2@} \right\}. \]</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>none</multiplicationsign>
    <sqrtsign>1</sqrtsign>
    <complexno>i</complexno>
    <inversetrig>cos-1</inversetrig>
    <logicsymbol>lang</logicsymbol>
    <matrixparens>[</matrixparens>
    <isbroken>0</isbroken>
    <variantsselectionseed/>
    <input>
      <name>ans</name>
      <type>algebraic</type>
      <tans>{ta1,ta2}</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>
    <input>
      <name>ansf</name>
      <type>algebraic</type>
      <tans>(cf1*v+a)*(cf2*v+b)</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>fac</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>FacForm</answertest>
        <sans>ansf</sans>
        <tans>(cf1*v+a)*(cf2*v+b)</tans>
        <testoptions>v</testoptions>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>fac-0-T </trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>fac-0-F </falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <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>elementp(?,ans)</sans>
        <tans>true</tans>
        <testoptions/>
        <quiet>1</quiet>
        <truescoremode>=</truescoremode>
        <truescore>0.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>1-0-T </trueanswernote>
        <truefeedback format="html">
          <text>Please replace \(?\) in the answer box with your answer and try again!</text>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>1</falsenextnode>
        <falseanswernote>1-0-F </falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
      <node>
        <name>1</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans</sans>
        <tans>{ta1, ta2 }</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>1-1-T </trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>1-1-F </falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <deployedseed>2060820372</deployedseed>
    <deployedseed>1584668898</deployedseed>
    <deployedseed>584521279</deployedseed>
    <deployedseed>1003735463</deployedseed>
    <deployedseed>497584038</deployedseed>
    <deployedseed>887938784</deployedseed>
    <deployedseed>1193189753</deployedseed>
    <deployedseed>525135563</deployedseed>
    <deployedseed>198574087</deployedseed>
    <deployedseed>1024221276</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans</name>
        <value>{ta1, ta2}</value>
      </testinput>
      <testinput>
        <name>ansf</name>
        <value>factor((cf1*v+a)*(cf2*v+b))</value>
      </testinput>
      <expected>
        <name>fac</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>fac-0-T</expectedanswernote>
      </expected>
      <expected>
        <name>prt1</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>1-1-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans</name>
        <value>{?,?}</value>
      </testinput>
      <testinput>
        <name>ansf</name>
        <value>ev(expand((cf1*v+a)*(cf2*v+b)),simp)</value>
      </testinput>
      <expected>
        <name>fac</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>fac-0-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt1</name>
        <expectedscore/>
        <expectedpenalty/>
        <expectedanswernote>NULL</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
