<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>29.1.4.19 vector line integral</text>
    </name>
    <questiontext format="moodle_auto_format">
      <text><![CDATA[<p>Evaluate the vector line integral \(\displaystyle \int_C \underline{F} \times \underline{\mathrm{d}r}\) when \(C\) represents the contour \(y = {@2*aa@} − {@2*aa@}x,\ z = {@aa@} − {@aa@}x\) from \((0, {@2*aa@}, {@aa@})\) to \((1, 0, 0)\) and F is the vector field \((x − z)\underline{j}\).</p>
<p>\(\displaystyle \int_C \underline{F} \times \underline{\mathrm{d}r} =\)[[input:ans1]]\(\underline{i} +\)[[input:ans2]]\(\underline{j} +\)[[input:ans3]]\(\underline{k}\) [[validation:ans1]] [[validation:ans2]] [[validation:ans3]]</p>]]></text>
    </questiontext>
    <generalfeedback format="moodle_auto_format">
      <text><![CDATA[<p>We have the contour \(y = {@2*aa@} − {@2*aa@}x,\ z = {@aa@} − {@aa@}x\) from \((0, {@2*aa@}, {@aa@})\) to \((1, 0, 0)\), and vector field \(\underline{F} = (x − z)\underline{j}\), and aim to evaluate \(\displaystyle \int_C \underline{F} \times \underline{\mathrm{d}r}\). This may be done as follows:</p>
\[\begin{aligned}
\underline{F} \times \underline{\mathrm{d}r} &= \begin{vmatrix}
\underline{i} & \underline{j} & \underline{k} \\
0 & x-z & 0 \\
\mathrm{d}x & \mathrm{d}y & \mathrm{d}z
\end{vmatrix}\\
&= \left( (x-z)\mathrm{d}z - (0)\right)\underline{i} - \left(0\right)\underline{j} + \left( (0) - (x-z)\mathrm{d}x\right)\underline{k} \\
&= (x-z)\mathrm{d}z\underline{i} + (z-x)\mathrm{d}x \underline{k}
\end{aligned}\]
So we can now evaluate the vector line integral as follows:
\[\begin{aligned}
\int_C \underline{F} \times \underline{\mathrm{d}r} & = \int_0^{@aa@} x-z\ \mathrm{d}z\underline{i} + \int^1_0 z-x\ \mathrm{d}x \underline{k}\\
&= \int_0^{@aa@} 1-(\frac{1}{{@aa@}}+1)z\ \mathrm{d}z\underline{i} + \int^1_0 {@aa@} - {@aa+1@}x\ \mathrm{d}x \underline{k}\\
&= \left[z - \frac{\frac{1}{{@aa@}}+1}{2}z^2\right]^0_{@aa@}\underline{i} + \left[{@aa@}x-\frac{{@aa+1@}}{2}x^2\right]^1_0\underline{k}\\
&={@aa-(aa+1)/2@}\underline{k} + {@-(aa-(aa+aa^2)/2)@}\underline{i}
\end{aligned}\]]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2025040100</text>
    </stackversion>
    <questionvariables>
      <text>aa:rand(5)+2;

ta1i:(aa+aa^2)/2 - aa;
ta1j:0;
ta1k:(aa-1)/2;</text>
    </questionvariables>
    <specificfeedback format="html">
      <text>[[feedback:prt1]]</text>
    </specificfeedback>
    <questionnote format="html">
      <text>\(y = {@2*aa@} − {@2*aa@}x,\ z = {@aa@} − {@aa@}x\)</text>
    </questionnote>
    <questiondescription format="html">
      <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>ta1i</tans>
      <boxsize>10</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>ans2</name>
      <type>algebraic</type>
      <tans>ta1j</tans>
      <boxsize>10</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>ans3</name>
      <type>algebraic</type>
      <tans>ta1k</tans>
      <boxsize>10</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/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans1</sans>
        <tans>ta1i</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>0</truescore>
        <truepenalty/>
        <truenextnode>1</truenextnode>
        <trueanswernote>prt1-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt1-1-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
      <node>
        <name>1</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans2</sans>
        <tans>ta1j</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>+</truescoremode>
        <truescore>0</truescore>
        <truepenalty/>
        <truenextnode>2</truenextnode>
        <trueanswernote>prt1-2-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt1-2-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
      <node>
        <name>2</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans3</sans>
        <tans>ta1k</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt1-3-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt1-3-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <deployedseed>1706030416</deployedseed>
    <deployedseed>459124138</deployedseed>
    <deployedseed>872366361</deployedseed>
    <deployedseed>1150489598</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description>Test case assuming the teacher's input gets full marks.</description>
      <testinput>
        <name>ans1</name>
        <value>ta1i</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>ta1j</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>ta1k</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt1-3-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ta1i</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>ta1j+6</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>ta1k</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty/>
        <expectedanswernote>prt1-2-F</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
