<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>2.5.3.3 The equation of a straight line through two points and second task</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p class="HELM_exercise">Exercise</p><br>
<ol class="HELM_parts">
<li>
<p>Find the equation of the line joining \(({@x3@}, {@y3@})\) and \(({@x4@}, {@y4@})\). Write it in the form \(y=ax+b\) in the box below:</p>
<p>[[input:ans1]] [[validation:ans1]][[feedback:prt1]]</p>
</li>
<li>
<p>Find the gradient and the vertical intercept of the line joining the points \(({@x5@}, {@y5@})\) and \(({@x6@}, {@y6@})\).</p>
<p>The gradient is [[input:ans2]] [[validation:ans2]] [[feedback:prt2]]</p>
<p>The vertical intercept is [[input:ans3]] [[validation:ans3]] [[feedback:prt3]]</p>
</li>
</ol>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text><![CDATA[<ol class="HELM_parts">
    <li>
        <p>Using the formula you already know, the equation of the line through the points \(({@x3@}, {@y3@})\) and \(({@x4@}, {@y4@})\) is: \[{@var2-y3@}= \dfrac{{@y4@}-({@y3@})}{{@x4@}-({@x3@})} \cdot ({@x-x3@}) \Rightarrow {@solution2@}\]</p>
    </li>
    <li>
        <p>Using the known formula of the gradient through the points \(({@x5@}, {@y5@})\) and \(({@x6@}, {@y6@})\), we have: \[ \text{gradient}= \dfrac{{@y6@}-({@y5@})}{{@x6@}-({@x5@})} = \displaystyle {@grad@}.\]</p>
        <p>The vertical intercept is the coefficient \[ ({@y6-y5@}) \cdot {@-x5/(x6-x5) + y5@} = {@vert@}\] that we can find in the expression of the line through two points.</p>
  </li>
</ol>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2021072200</text>
    </stackversion>
    <questionvariables>
      <text>var1:x;
var2:y;

x3: rand_with_prohib(-9,9,[0]);
x4: rand_with_prohib(-9,9,[x3]);
y3: rand_with_step(-9,9,1);
y4: rand_with_prohib(-9,9,[y3]);
solution2: var2=(y4-y3)*(var1)/(x4-x3)+((y4-y3)*(-x3)/(x4-x3)+y3);

x5: rand_with_prohib(-9,9,[0]);
x6: rand_with_prohib(-9,9,[x5]);
y5: rand_with_step(-9,9,1);
y6: rand_with_prohib(-9,9,[y5]);
lineq: var2=(y6-y5)*(var1)/(x6-x5)+((y6-y5)*(-x5)/(x6-x5)+y6);

simp:false;   /* turn simp off so that display nice signs in worked solution */
grad1: (y4-y3)/(x4-x3);
grad2: (y6-y5)/(x6-x5);  
grad: ev(grad2,simp);
vert1: ((y6-y5)*(-x5)/(x6-x5)+y5);
vert: ev(vert1,simp);</text>
    </questionvariables>
    <specificfeedback format="html">
      <text/>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>Points \(({@x3@}, {@y3@}), \, ({@x4@}, {@y4@}),\)  {@solution2@}</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>ans1</name>
      <type>algebraic</type>
      <tans>solution2</tans>
      <boxsize>8</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>0</mustverify>
      <showvalidation>3</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans2</name>
      <type>numerical</type>
      <tans>grad</tans>
      <boxsize>5</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>0</mustverify>
      <showvalidation>3</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans3</name>
      <type>numerical</type>
      <tans>vert</tans>
      <boxsize>5</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>0</mustverify>
      <showvalidation>3</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>solution2</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>
    <prt>
      <name>prt2</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>EqualComAss</answertest>
        <sans>ans2</sans>
        <tans>grad</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt2-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt2-1-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <prt>
      <name>prt3</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>EqualComAss</answertest>
        <sans>ans3</sans>
        <tans>vert</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt3-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt3-1-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <deployedseed>1002811827</deployedseed>
    <deployedseed>716930293</deployedseed>
    <deployedseed>95947040</deployedseed>
    <deployedseed>267066736</deployedseed>
    <deployedseed>1834848419</deployedseed>
    <deployedseed>1838878292</deployedseed>
    <deployedseed>147258786</deployedseed>
    <deployedseed>157349562</deployedseed>
    <deployedseed>1963676209</deployedseed>
    <deployedseed>1130890260</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>solution2</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>grad</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>vert</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt1-1-T</expectedanswernote>
      </expected>
      <expected>
        <name>prt2</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt2-1-T</expectedanswernote>
      </expected>
      <expected>
        <name>prt3</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt3-1-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ev(var2=(y4-y3)*(var1)/(x4-x3)+((y4-y3)*(-x3)/(x4-x3)+y3)+1,simp)</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>grad+1</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>vert+1</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt1-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt2</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt2-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt3</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt3-1-F</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
