<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>7.1.10 (Parabola - line intersection)</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>Find the points of intersection of \( y = {@quad@}\) and \( y = {@line@} \).</p><p>Points of intersection: [[input:ans1]][[feedback:prt1]] [[validation:ans1]]<br></p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text><![CDATA[<p>We are asked to find the points of intersection of \( y = {@quad@}\) and \( y = {@line@} \), so we solve:</p><p>\[\begin{align*} {@quad@} &amp;= {@line@} \\ {@quad-line@} &amp;= 0 \\ {@factor(quad-line)@} &amp;=0\end{align*} \]</p><p>So the solutions are \(x_1={@a@}\), \(x_2={@b@}\).</p><p>For \( x_1 = {@a@}, \quad y_1 = {@y_a@} \).</p><p>For \( x_2 = {@b@}, \quad y_2 = {@y_b@} \).<br></p><p>So, the intersection points are {@ta1@}.</p>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2020081700</text>
    </stackversion>
    <questionvariables>
      <text>a:rand_with_prohib(-6,6,[0]);
b:rand_with_prohib(-6,6,[0,a]);
p:rand_with_prohib(-8,8,[0,1,-1]);
q:rand_with_prohib(-8,8,[0,1,-1]);

quad:expand( (x-a)*(x-b) )+p*x+q;
line:p*x+q;     /*the intersection point are x=a or y=b */

y(x):= p*x+q
y_a: y(a)     /*find the y value for x=a */
y_b: y(b)     /*find the y value for x=b */
ta1: {[a,y_a], [b,y_b]}

Delta: (a+b)^2-4*1*a*b</text>
    </questionvariables>
    <specificfeedback format="html">
      <text/>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>\(y= {@quad@}\), \( y = {@line@} \) so intersection points {@ta1@}</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>algebraic</type>
      <tans>ta1</tans>
      <boxsize>15</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint>{[x1,y1], [x2,y2]}</syntaxhint>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords>x1,y1,x2,y2</forbidwords>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>1</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>ta1</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt1-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt1-1-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <deployedseed>101814634</deployedseed>
    <deployedseed>1875031177</deployedseed>
    <deployedseed>1809090747</deployedseed>
    <deployedseed>1298422744</deployedseed>
    <deployedseed>1825027414</deployedseed>
    <deployedseed>2062020576</deployedseed>
    <deployedseed>1718938540</deployedseed>
    <deployedseed>759294344</deployedseed>
    <deployedseed>646542663</deployedseed>
    <deployedseed>1494771455</deployedseed>
    <deployedseed>1234072207</deployedseed>
    <deployedseed>242179851</deployedseed>
    <deployedseed>280071355</deployedseed>
    <deployedseed>27104323</deployedseed>
    <deployedseed>1834134220</deployedseed>
    <deployedseed>1597357180</deployedseed>
    <deployedseed>1126914283</deployedseed>
    <deployedseed>1376122253</deployedseed>
    <deployedseed>542009771</deployedseed>
    <deployedseed>1180993920</deployedseed>
    <deployedseed>883120720</deployedseed>
    <deployedseed>745851448</deployedseed>
    <deployedseed>653467132</deployedseed>
    <deployedseed>1078106084</deployedseed>
    <deployedseed>2144102078</deployedseed>
    <deployedseed>446910410</deployedseed>
    <deployedseed>1673224650</deployedseed>
    <deployedseed>1296568552</deployedseed>
    <deployedseed>221282792</deployedseed>
    <deployedseed>1474364848</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ta1</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt1-1-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ta1+1</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt1-1-F</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
