<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>13.3.2.6 Area under a curve</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p class="HELM_exercise">Exercise</p><p><span style="font-size: calc(0.90375rem + 0.045vw);">Find the area bounded by the curve \(y = {@exp3@}\) and the t-axis between \(t = {@l3@}\) and \(t = {@u3@}\). [[input:ans3]] [[validation:ans3]] [[feedback:prt3]]</span></p><p><span style="font-size: calc(0.90375rem + 0.045vw);">You should check that the required area lies entirely above the horizontal axis.</span></p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text><![CDATA[<p>Since the required area lies entirely above the horizontal axis for each question, the area under the curve \(y\) between \(t = a\) and \(t = b\) is \(\displaystyle\int_{a}^{b} y(t) \, \mathrm{d}t\).</p>
<p><span style="font-size: calc(0.90375rem + 0.045vw);">\(\displaystyle \int_{@l3@}^{@u3@} {@exp3@} \, \mathrm{d}t = \left[ {@int(exp3,t)@} \right]_{@l3@}^{@u3@} = {@ta3@}.\)</span></p><br>
<p>A sketch of the graph is shown below.</p>

<p style="text-align: center;"></p>
        <div style="margin-left:4em;margin-right:auto;">[[jsxgraph width='350px' height='350px']] 
JXG.Options.axis.ticks.insertTicks = false; /*don't insert extra ticks between major ticks*/ 
JXG.Options.axis.ticks.majorHeight = 10; 
JXG.Options.axis.ticks.minorHeight = 0; /*if minor ticks needed adjust height*/
JXG.Options.text.fontSize = 16; 
JXG.Options.axis.ticks.ticksDistance=1000; 
var board = JXG.JSXGraph.initBoard(divid, {boundingbox: {#BB#}, axis: false, showCopyright:false, showNavigation:false}); 
var f = board.jc.snippet('{#exp3#}', true, 't', true); 
var ff = board.create('functiongraph',[f,{#ev(l3-0.1)#},{#ev(u3+0.1)#}]); 
var i1 = board.create('integral', [{#[l3,u3]#}, ff], {fillColor:'#003399',fillOpacity:0.15}); 
i1.curveLeft.setAttribute({visible:false}); /* hide the gliders */ 
i1.curveRight.setAttribute({visible:false});
i1.label.setAttribute({visible:false}); /*hide the integral calculation*/ 
var xaxis = board.create('axis', [[0,0],[1,0]], {name:'t', withLabel: true, label: {position: 'rt', offset: [-10, 10] /* (in pixels)*/}}); 
board.create('ticks', [xaxis, {#[l3,u3]#}],{strokeColor:'#003399', majorHeight:15, drawLabels: true, label: { offset: [0, -5],anchorX: 'middle', anchorY: 'top' }}); 
var yaxis = board.create('axis', [[0, 0], [0, 1]], {name:'y', withLabel: true, label: {position: 'rt', offset: [-20, 0] }}); 
/*yaxis.removeAllTicks();*/
board.create('ticks', [yaxis, {#[a,b]#}],{strokeColor:'#003399', majorHeight:15, drawLabels: true, label: { offset: [-10, 0],anchorX: 'right', anchorY: 'middle' }}); 
[[/jsxgraph]]
</div>
<p></p>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2020120600</text>
    </stackversion>
    <questionvariables>
      <text>cc: rand(4) + 2;
exp3: cc*t^2; 
u3: rand([2,3,4]);   /*upper limit*/
l3: -u3;                  /*lower limit*/
ta3: int(exp3, t, l3, u3);

/*jsxgraph settings */ 
BB: [l3-1, cc*(u3+0.3)^2, u3+1, -(1/6)*cc*(u3+0.3)^2]     /* boundingbox:[left, top, right, bottom]*/ 
a: ev(exp3, t=l3);    /* y axis ticks*/
b: ev(exp3, t=u3);

/*Maxima plot: is not used in this question, we used JSX Graphs instead*/
plot1: plot(exp3, [t, l3-1,u3+1], [y, 0, cc*(u3)^2+1], [box, false], [axes,solid]);</text>
    </questionvariables>
    <specificfeedback format="html">
      <text/>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>\(\int_{@l3@}^{@u3@} {@exp3@} \, \mathrm{d}t = {@ta3@} \)</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>ans3</name>
      <type>numerical</type>
      <tans>ta3</tans>
      <boxsize>7</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>1</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>3</showvalidation>
      <options/>
    </input>
    <prt>
      <name>prt3</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans3</sans>
        <tans>ta3</tans>
        <testoptions>t</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>787868220</deployedseed>
    <deployedseed>1380712259</deployedseed>
    <deployedseed>59799108</deployedseed>
    <deployedseed>1481054855</deployedseed>
    <deployedseed>1923449942</deployedseed>
    <deployedseed>1922075904</deployedseed>
    <deployedseed>471268570</deployedseed>
    <deployedseed>2071998159</deployedseed>
    <deployedseed>2059254581</deployedseed>
    <deployedseed>670758434</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans3</name>
        <value>ta3</value>
      </testinput>
      <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>ans3</name>
        <value>ev(ta3+1,simp)</value>
      </testinput>
      <expected>
        <name>prt3</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt3-1-F</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
