<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>2.3.22 (Spot the translated graph)</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<div class="center">            <p class="noindent">            </p><p class="noindent">The graph of a function \(y = f(x)\) is given below:<br></p><p class="noindent">{@plot(p,XL,YL,[box, false],[yx_ratio, 1],[axes, solid],[xtics, -10, 2,10],[ytics, -10, 2, 10])@}</p><p class="noindent">Which graph shows the graph of the function \(f({@x+a@})+{@b@}\)?<br></p><p class="noindent">[[input:ans1]] [[validation:ans1]]&nbsp;<br></p></div><table>
  <tbody><tr>
    <td style="text-align: center;"><span><b>Graph A</b></span></td>
    <td style="text-align: center;"><span><b>Graph B</b></span></td>
  </tr>
  <tr>
    <td style="text-align: center;">{@plot(plist[1],XL,YL,[box, false],[yx_ratio, 1],[axes, solid],[xtics, -10, 2,10],[ytics, -10, 2, 10],[alt,"Graph A"])@}</td>
    <td style="text-align: center;">{@plot(plist[2],XL,YL,[box, false],[yx_ratio, 1],[axes, solid],[xtics,-10, 2,10],[ytics, -10, 2, 10],[alt,"Graph B"])@}</td>
  </tr><tr>
    <td style="text-align: center;">&nbsp;</td>
    <td style="text-align: center;">&nbsp;</td>
  </tr>
  <tr>
    <td style="text-align: center;"><b>Graph C</b></td>
    <td style="text-align: center;"><b>Graph D</b></td>
  </tr>
  <tr>
    <td style="text-align: center;">{@plot(plist[3],XL,YL,[box, false],[yx_ratio, 1],[axes, solid],[xtics, -10, 2, 10],[ytics, -10, 2, 10],[alt,"Graph C"])@}</td>
    <td style="text-align: center;">{@plot(plist[4],XL,YL,[box, false],[yx_ratio, 1],[axes, solid],[xtics, -10, 2, 10],[ytics, -10, 2, 10],[alt,"Graph D"])@}</td>
  </tr>
</tbody></table><p><br></p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text><![CDATA[<p class="noindent">The graph of \(f(x+a)\) is the graph of \(f(x)\) translated horizontally \(a\) units left if \(a\) is positive, and right if \(a\) is negative.&nbsp; The graph of \(f(x) + b\) is the graph of \(f(x)\) translated vertically \(b\) units upwards if \(b\) is positive, and downwards if \(b\) is negative.<br></p>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2020070100</text>
    </stackversion>
    <questionvariables>
      <text><![CDATA[/* Make sure m<>1, or adjust the list of options. */
m:2;
/* Make sure a<>b. */
amag:2+rand(2);
pm1:rand([-1,1]);
pm2:rand([-1,1]);
bmag:1+rand(2);
a:pm1*amag;
b:pm2*bmag;
p:2*(x+1)^2 -3;
q:2*(x+1+a)^2-3+b;
flistpre:[2*(x+1+a)^2 -3,2*(x+1)^2 +b,2*(x+1-a)^2,2*(x+1)^2 -b,2*(x+1-a)^2 -3+b,2*(x+1-a)^2 -b];
flist:rand_selection(flistpre,3);
flist:append([[q,true]],maplist(lambda([ex],[ex,false]),flist));
flist:random_permutation(flist);
/* Define axes */
YL:[y,-5,5]
XL:[x,-5,5]
/* Create a list of just the plots, to plot. */
plist:map(first,flist);
/* Identify both the correct answer, and the position of the correct answer. */
tac:first(mcq_correct(flist));
n:first(sublist_indices(flist, lambda([ex],second(ex))));
corletter:[A,B,C,D][n];
ta1:maplist(lambda([letter],[letter,is(letter=corletter),sconcat("Graph ",letter)]),[A,B,C,D]);]]></text>
    </questionvariables>
    <specificfeedback format="html">
      <text><![CDATA[<p>[[feedback:prt1]]<br></p>]]></text>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>{@flist@} f is element {#n#}, \(y= {@p@}\)</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>dropdown</type>
      <tans>ta1</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>0</mustverify>
      <showvalidation>0</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>corletter</tans>
        <testoptions/>
        <quiet>0</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>
    </prt>
    <deployedseed>523249711</deployedseed>
    <deployedseed>468180050</deployedseed>
    <deployedseed>1844929686</deployedseed>
    <deployedseed>2093103290</deployedseed>
    <deployedseed>814935729</deployedseed>
    <deployedseed>224944053</deployedseed>
    <deployedseed>947232432</deployedseed>
    <deployedseed>865759878</deployedseed>
    <deployedseed>1921995989</deployedseed>
    <deployedseed>2060199992</deployedseed>
    <deployedseed>534734959</deployedseed>
    <deployedseed>1877066646</deployedseed>
    <deployedseed>1839151412</deployedseed>
    <deployedseed>125437095</deployedseed>
    <deployedseed>953755384</deployedseed>
    <deployedseed>1713459938</deployedseed>
    <deployedseed>719484830</deployedseed>
    <deployedseed>501438565</deployedseed>
    <deployedseed>954287609</deployedseed>
    <deployedseed>458607172</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>corletter</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt1-0-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>delete(corletter,[A,B,C,D])[1]</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt1-0-F</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
