<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>9.5.3.4 Vector equation of a line through two points in 3D Exercise</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p class="HELM_exercise">Exercise</p>
<p>Write down the vector equation of the line which passes through the points with position vectors \(\underline{ a}={@A1@}\) and <span class="math inline">\({@stackvector(b)@}=
{@B1@}\). </span></p><p>Use the variable \(t\) in your answer. </p>
<p></p><p>\({@stackvector(r)@}=\) [[input:ans1i]] [[validation:ans1i]] \({@stackvector(i)@}+{}\) [[input:ans1j]] [[validation:ans1j]] \({@stackvector(j)@}+{}\)[[input:ans1k]] [[validation:ans1k]] \({@stackvector(k)@}\) [[feedback:prt1]]
</p>

<p>Also express the equation in column vector form.</p>
<div>\({@stackvector(r)@}=\) [[input:ans2b]] [[validation:ans2b]] \({}+t\ \) [[input:ans2d]] [[validation:ans2d]]</div>
<p>[[feedback:prt2]]</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text><![CDATA[<p>The vector \(\overrightarrow{AB}\) is given by</p>
\[{@stackvector(b)@}-{@stackvector(a)@} = {@B1@} - ({@A1@}) = {@R1@}.\]
<p>The equation of the line is then</p>
\[\begin{aligned}
{@stackvector(r)@} &amp;= {@stackvector(a)@} + t({@stackvector(b)@}-{@stackvector(a)@}) \\
&amp;= <br>{@A1@} + t<br>({@R1@}).
\end{aligned}\] 
<p>Using column vector notation we could write</p>
\[{@stackvector(r)@} = {@a1@}+t\,{@r1@}.\]]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2021072200</text>
    </stackversion>
    <questionvariables>
      <text><![CDATA[stackvectortex(ex):= block(sconcat("{ \\underline{", tex1(first(args(ex))), "}}"));
ordergreat(i,j,k,l);
/*two distinct vectors*/
a1: matrix([5],[3],[5]) - rand(matrix([10],[3],[10]));
b1: matrix([5],[8],[5]) - rand(matrix([10],[2],[10]));
r1:  b1-a1;
negr1: -r1;
u1: matrix([i],[j],[k]);
A1: texboldatoms(dotproduct(a1,u1));
B1: texboldatoms(dotproduct(b1,u1));
R1:  texboldatoms(dotproduct(r1,u1));

l1: a1+t*r1;
l2: b1-t*r1;]]></text>
    </questionvariables>
    <specificfeedback format="html">
      <text/>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>\[{@stackvector(a)@}={@A1@} \quad \text{ and } \quad {@stackvector(b)@} = {@B1@}\]
\[\underline{r}= ({@a1[1,1]+t*r1[1,1]@}) i + ({@a1[2,1]+t*r1[2,1]@}) j+ ({@l1[3,1]@})k\]</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>symi</complexno>
    <inversetrig>cos-1</inversetrig>
    <logicsymbol>lang</logicsymbol>
    <matrixparens>[</matrixparens>
    <isbroken>0</isbroken>
    <variantsselectionseed/>
    <input>
      <name>ans1i</name>
      <type>algebraic</type>
      <tans>a1[1,1]+t*r1[1,1]</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>1</mustverify>
      <showvalidation>3</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans1j</name>
      <type>algebraic</type>
      <tans>a1[2,1]+t*r1[2,1]</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>1</mustverify>
      <showvalidation>3</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans1k</name>
      <type>algebraic</type>
      <tans>l1[3,1]</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>1</mustverify>
      <showvalidation>3</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans2b</name>
      <type>matrix</type>
      <tans>a1</tans>
      <boxsize>3</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>3</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans2d</name>
      <type>matrix</type>
      <tans>r1</tans>
      <boxsize>3</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>3</showvalidation>
      <options/>
    </input>
    <prt>
      <name>prt1</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text>ans1:matrix([ans1i], [ans1j],[ans1k]);
/*have simplified the potential response tree to just mark a valid answer, it is hard to write out the response tree to check each entry particularly when line might go in ab direction OR ba direction*/</text>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans1</sans>
        <tans>a1+t*r1</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>4</falsenextnode>
        <falseanswernote>prt1-1-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
      <node>
        <name>4</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans1</sans>
        <tans>l2</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>+</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt1-5-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt1-5-F</falseanswernote>
        <falsefeedback format="html">
          <text>Please check your calculations.</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>AlgEquiv</answertest>
        <sans>ans2b</sans>
        <tans>a1</tans>
        <testoptions/>
        <quiet>1</quiet>
        <truescoremode>=</truescoremode>
        <truescore>0.0000000</truescore>
        <truepenalty/>
        <truenextnode>2</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>
      <node>
        <name>1</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans2b</sans>
        <tans>b1</tans>
        <testoptions/>
        <quiet>1</quiet>
        <truescoremode>+</truescoremode>
        <truescore>0.0000000</truescore>
        <truepenalty/>
        <truenextnode>3</truenextnode>
        <trueanswernote>prt2-2-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt2-2-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
      <node>
        <name>2</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans2d</sans>
        <tans>r1</tans>
        <testoptions/>
        <quiet>1</quiet>
        <truescoremode>+</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt2-3-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt2-3-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
      <node>
        <name>3</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans2d</sans>
        <tans>-r1</tans>
        <testoptions/>
        <quiet>1</quiet>
        <truescoremode>+</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt2-4-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt2-4-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <deployedseed>1370144594</deployedseed>
    <deployedseed>299382261</deployedseed>
    <deployedseed>1461515714</deployedseed>
    <deployedseed>1907806266</deployedseed>
    <deployedseed>1141557858</deployedseed>
    <deployedseed>324292980</deployedseed>
    <deployedseed>1592631018</deployedseed>
    <deployedseed>915009070</deployedseed>
    <deployedseed>1455147828</deployedseed>
    <deployedseed>1256714078</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans1i</name>
        <value>a1[1,1]+t*r1[1,1]</value>
      </testinput>
      <testinput>
        <name>ans1j</name>
        <value>a1[2,1]+t*r1[2,1]</value>
      </testinput>
      <testinput>
        <name>ans1k</name>
        <value>a1[3,1]+t*r1[3,1]</value>
      </testinput>
      <testinput>
        <name>ans2b</name>
        <value>a1</value>
      </testinput>
      <testinput>
        <name>ans2d</name>
        <value>r1</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-3-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans1i</name>
        <value>b1[1,1]-t*r1[1,1]</value>
      </testinput>
      <testinput>
        <name>ans1j</name>
        <value>b1[2,1]-t*r1[2,1]</value>
      </testinput>
      <testinput>
        <name>ans1k</name>
        <value>b1[3,1]-t*r1[3,1]</value>
      </testinput>
      <testinput>
        <name>ans2b</name>
        <value>b1</value>
      </testinput>
      <testinput>
        <name>ans2d</name>
        <value>negr1</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt1-5-T</expectedanswernote>
      </expected>
      <expected>
        <name>prt2</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt2-4-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>3</testcase>
      <description/>
      <testinput>
        <name>ans1i</name>
        <value>10</value>
      </testinput>
      <testinput>
        <name>ans1j</name>
        <value>30</value>
      </testinput>
      <testinput>
        <name>ans1k</name>
        <value>10</value>
      </testinput>
      <testinput>
        <name>ans2b</name>
        <value>a1</value>
      </testinput>
      <testinput>
        <name>ans2d</name>
        <value>negr1</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty/>
        <expectedanswernote>prt1-5-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt2</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty/>
        <expectedanswernote>prt2-3-F</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>4</testcase>
      <description/>
      <testinput>
        <name>ans1i</name>
        <value>30</value>
      </testinput>
      <testinput>
        <name>ans1j</name>
        <value>30</value>
      </testinput>
      <testinput>
        <name>ans1k</name>
        <value>30</value>
      </testinput>
      <testinput>
        <name>ans2b</name>
        <value>b1</value>
      </testinput>
      <testinput>
        <name>ans2d</name>
        <value>r1</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty/>
        <expectedanswernote>prt1-5-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt2</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty/>
        <expectedanswernote>prt2-4-F</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
