<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>9.3.20 (Which is the correct partial fraction decomposition? 2)</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p class="noindent">Which of the following is the correct form of the partial fraction decomposition of \(\displaystyle{@pfrac1@}\)?<br></p>  
 [[input:ans1]] [[validation:ans1]]]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text><![CDATA[<p>For the repeated linear factor {@(x-a)^2@} we add the terms \(\displaystyle{@'A/(x-a)+'B/(x-a)^2@}\).</p><p>For the irreducible quadratic factor {@x^2+b*x+c@} we add the term \(\dfrac{Cx+D}{@x^2+b*x+c@}\).</p>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2020081700</text>
    </stackversion>
    <questionvariables>
      <text><![CDATA[a:rand_range(1,5,1);
b:rand_range(2,4,1); /* avoid using 1 since the question prints out bx naively */
c:rand_range(ceiling(b^2/4),10,1); /* to ensure discriminant is negative */
k:rand_selection(delete(0,makelist(i,i,-7,7)),4);
pfrac1:(k[1]*x^2+k[2]*x+k[3])/((x-a)^2*(x^2+b*x+c));
/* list of: truth, statement  */
statements:[[true,sconcat("\\(\\dfrac{A}{(x-",a,")}+\\dfrac{B}{(x-",a,")^2}+\\dfrac{Cx+D}{x^2+",b,"x+",c,"}\\)")],[false,sconcat("\\(\\dfrac{A}{(x-",a,")^2}+\\dfrac{Bx+C}{x^2+",b,"x+",c,"}\\)")],[false,sconcat("\\(\\dfrac{A}{(x-",a,")}+\\dfrac{B}{(x-",a,")}+\\dfrac{Cx+D}{x^2+",b,"x+",c,"}\\)")],[false,sconcat("\\(\\dfrac{A}{(x-",a,")}+\\dfrac{B}{(x-",a,")^2}+\\dfrac{C}{x^2+",b,"x+",c,"}\\)")]];
/* shuffle */
reordering:random_permutation([1,2,3,4]);
statements:makelist(statements[i],i,reordering);
/* add letters, and append the letters to the text of the statements: */
statements:makelist([sconcat("(",ascii(96+i),")"),statements[i][1],statements[i][2]],i,1,length(statements));
statements:maplist(lambda([ex],[ex[1],ex[2],sconcat("<b>",ex[1],"</b> ",ex[3])]),statements);
/* produce lists of correct and incorrect statements: */
ans:mcq_correct(statements);
incorr:maplist(first, sublist(statements, lambda([ex], not(second(ex)))));

/* the grading awards 1 mark to a completely correct response, 0.5 if their selection is a proper subset of the true statements, and 0 otherwise */]]></text>
    </questionvariables>
    <specificfeedback format="html">
      <text>[[feedback:prt1]]</text>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>{@pfrac1@} {#reordering#}</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>ans1</name>
      <type>checkbox</type>
      <tans>statements</tans>
      <boxsize>15</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>1</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>0</mustverify>
      <showvalidation>0</showvalidation>
      <options/>
    </input>
    <prt>
      <name>prt1</name>
      <value>1.0000000</value>
      <autosimplify>0</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>setify(ans1)</sans>
        <tans>setify(ans)</tans>
        <testoptions/>
        <quiet>1</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty>0</truepenalty>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt1-0-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty>0.1</falsepenalty>
        <falsenextnode>1</falsenextnode>
        <falseanswernote>prt1-0-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
      <node>
        <name>1</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>subsetp(setify(ans1),setify(ans))</sans>
        <tans>true</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>+</truescoremode>
        <truescore>0.5000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt1-2-T</trueanswernote>
        <truefeedback format="html">
          <text><![CDATA[<p>You have correctly identified one of the correct answers, but missed \({@setdifference(setify(ans),setify(ans1))@}\).<br></p>]]></text>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>2</falsenextnode>
        <falseanswernote>prt1-2-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
      <node>
        <name>2</name>
        <description/>
        <answertest>CasEqual</answertest>
        <sans>cardinality(ev(intersection(setify(incorr),setify(ans1)),simp))</sans>
        <tans>0</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>+</truescoremode>
        <truescore>0.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt1-3-T</trueanswernote>
        <truefeedback format="html">
          <text><![CDATA[<p><br></p><p>{@setify(ans1)@}<br></p><p>{@(intersection(setify(incorr),setify(ans1)))@}<br></p><p>{@cardinality(intersection(setify(incorr),setify(ans1)))@}</p>]]></text>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt1-3-F</falseanswernote>
        <falsefeedback format="html">
          <text><![CDATA[<p>You incorrectly selected {@(setdifference(setify(ans1),setify(ans)))@}<br></p>]]></text>
        </falsefeedback>
      </node>
    </prt>
    <deployedseed>376215758</deployedseed>
    <deployedseed>198470193</deployedseed>
    <deployedseed>1908755696</deployedseed>
    <deployedseed>1629791793</deployedseed>
    <deployedseed>976331118</deployedseed>
    <deployedseed>776156365</deployedseed>
    <deployedseed>215043679</deployedseed>
    <deployedseed>1800212388</deployedseed>
    <deployedseed>214599349</deployedseed>
    <deployedseed>1188863207</deployedseed>
    <deployedseed>1076217763</deployedseed>
    <deployedseed>1398601119</deployedseed>
    <deployedseed>1487876022</deployedseed>
    <deployedseed>10030737</deployedseed>
    <deployedseed>148556211</deployedseed>
    <deployedseed>779875450</deployedseed>
    <deployedseed>351032198</deployedseed>
    <deployedseed>248725686</deployedseed>
    <deployedseed>1119104389</deployedseed>
    <deployedseed>1610805782</deployedseed>
    <deployedseed>423811351</deployedseed>
    <deployedseed>1532604770</deployedseed>
    <deployedseed>1536883846</deployedseed>
    <deployedseed>1679366592</deployedseed>
    <deployedseed>119416326</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>[incorr[1]]</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt1-3-F</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ans</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt1-0-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>3</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>[ans[1],incorr[1]]</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt1-3-F</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
