<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>Diagnostic_ALG-SPF_3</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>Give the expression</p>
<p>\[{@f@}\]</p>
<p>as a sum of partial fractions.</p>
<p>[[input:Sanswer]]</p>
<p>[[validation:Sanswer]]</p>
<p>&nbsp;</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text><![CDATA[<p></p>Below are the rules of partial fractions.[[facts:alg_partial_fractions]]<p><br></p><p>Applying these rules, we find that \[ {@f@} = \frac{A}{x} + \frac{B}{@den1@} + \frac{C}{@den2@},\]</p>
<p>and multiplying through by the denominator {@den@} we see that</p>
<p>\[ {@numerat@} = {@term1@} + {@Bxden2@} + {@Cxden1@}. \]</p>
<p>Setting \(x = 0\) we see that \(A = {@Aval@}\), setting \(x= {@mc@}\) we see that \(B = {@Bval@}\) and setting \(x = {@md@}\) we see that \(C = {@Cval@}\). Therefore</p>
<p>\[ {@f@} = {@answer@}.\]</p>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2018080600</text>
    </stackversion>
    <questionvariables>
      <text>a:rand(8)+2;
mag_b:rand(8)+2;
sign_b:2*rand(2)-1;
b:mag_b*sign_b;
mag_c:rand(8)+2;
sign_c:2*rand(2)-1;
c:mag_c*sign_c;
mag_d:rand(8)+2;
d:- mag_d*sign_c;
cd:c * d;
Aval:b/cd;
Bval:(a-b/c)/(d-c);
Cval:-Aval - Bval;
den1:x + c;
den2:x + d;
den:x * den1 * den2;
numerat:a*x+b;
mc:-c;
md:-d;
f:numerat/den;
answer:partfrac(f,x);
term1:A * den1 * den2;
Bxden2:B * x * den2;
Cxden1:C * x * den1;</text>
    </questionvariables>
    <specificfeedback format="html">
      <text><![CDATA[<p>[[feedback:Result]]</p>]]></text>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>\[{@f@} = {@answer@}.\]</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>Sanswer</name>
      <type>algebraic</type>
      <tans>answer</tans>
      <boxsize>20</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>PartFrac</answertest>
        <sans>Sanswer</sans>
        <tans>answer</tans>
        <testoptions>x</testoptions>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>ALG-SPF-TRUE </trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>ALG-SPF-FALSE </falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <deployedseed>1516585941</deployedseed>
    <deployedseed>398737190</deployedseed>
    <deployedseed>2019821996</deployedseed>
    <deployedseed>845595963</deployedseed>
    <deployedseed>1443137074</deployedseed>
    <deployedseed>1430993911</deployedseed>
    <deployedseed>1040131426</deployedseed>
    <deployedseed>229588864</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>Sanswer</name>
        <value>answer</value>
      </testinput>
      <expected>
        <name>Result</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>ALG-SPF-TRUE</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>Sanswer</name>
        <value>f</value>
      </testinput>
      <expected>
        <name>Result</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>ALG-SPF-FALSE </expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
