<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>4.1.2.4 Find sides and angles triangle</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>Obtain the specified sides and angles for the following right-angled triangle where angle \( \hat{B} = {@thB@}^\circ {@min@}'\) and side \(c = {@cc@}.\)</p>
<p>Keep 2 decimal places in your answers.</p>
[[jsxgraph width='250px' height='200px']] 
var board = JXG.JSXGraph.initBoard(divid, {boundingbox: [-1, 6, 7, -1], keepAspectRatio: true,showCopyright: false, showNavigation: false}); 
var p = board.create('point', [0,4], {name: "A", fixed:true}); 
var q = board.create('point',[6.5,0],{name:"B", fixed:true});
var r = board.create('point', [0,0], {name: "C", fixed:true, label:{autoPosition: true, offset:[-10, -10]}});
var poly1 = board.create('polygon',[p,q,r]);
var angle1 = board.create('angle',["B", "C", "A"], {radius:0.7, name: '90 &deg'});
var angle2 = board.create('angle',["A", "B", "C"], {radius:1.4, name: '{#thB#} &deg {#min#} &acute ',  label:{autoPosition: true, offset:[-2, -2]}});
board.create('text', [3, 2.4, {#cc#}]); 
board.create('text', [2.8, -0.5, "a"]); 
board.create('text', [-0.5, 2, "b"]); 
[[/jsxgraph]]

<p>\( \hat{A} = \) [[input:ans1]] [[validation:ans1]] [[feedback:prt1]]</p>
<p>\( a= \) [[input:ans2]] [[validation:ans2]] [[feedback:prt2]]</p>
<p>\( b= \) [[input:ans3]] [[validation:ans3]] [[feedback:prt3]]</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text><![CDATA[<p>This is case 1.</p>
<p>First we transform angle \( \hat{B}\) to degrees: \( \hat{B} = {@thB@}^\circ {@min@}' = {@th@}^\circ.\)</p>
<p>Then we can easily find angle at \( A\) which is \(\hat{A} = 180^\circ - (90^\circ+{@th@}^\circ) = {@thA@}.\)</p>
<p>So \( \cos {@th@} = \dfrac{a}{@cc@} \Rightarrow a = {@cc@} \cos {@th@} = {@ta2@}. \)</p>
<p>Finally \( \sin {@th@} = \dfrac{b}{@cc@} \Rightarrow b= {@cc@} \sin {@th@} = {@ta3@}.\)</p>
<p>(Alternatively, of course, Pythagoras’ theorem could be used to calculate the length \(b\).)</p>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2021120900</text>
    </stackversion>
    <questionvariables>
      <text>cc: rand([14,15,16,17])
thB: rand([30,31,32]);
min: rand([20,25,30,35,40]);

th: decimalplaces(thB+min/60,2);  /* transform angle B into degrees*/
thA: 180- (90+th);
ta2: decimalplaces(cc*cos(th*%pi/180),2);
ta3: decimalplaces(cc*sin(th*%pi/180),2);
ta3alt: decimalplaces(sqrt(cc^2-ta2^2),2);</text>
    </questionvariables>
    <specificfeedback format="html">
      <text/>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>\[\hat{B}= {@thB@}^\circ {@min@}' ={@th@}^\circ, \, \hat{A} = {@thA@}\]
\[c= {@cc@}, \, a= {@ta2@}, \, b = {@ta3@}\, or \, {@ta3alt@} \]</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>numerical</type>
      <tans>thA</tans>
      <boxsize>8</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>0</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>3</showvalidation>
      <options>mindp:2, maxdp:2</options>
    </input>
    <input>
      <name>ans2</name>
      <type>numerical</type>
      <tans>ta2</tans>
      <boxsize>8</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>0</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>3</showvalidation>
      <options>mindp:2, maxdp:2</options>
    </input>
    <input>
      <name>ans3</name>
      <type>numerical</type>
      <tans>ta3</tans>
      <boxsize>8</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>0</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>3</showvalidation>
      <options>mindp:2, maxdp:2</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>NumDecPlaces</answertest>
        <sans>ans1</sans>
        <tans>thA</tans>
        <testoptions>2</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>NumDecPlaces</answertest>
        <sans>ans2</sans>
        <tans>ta2</tans>
        <testoptions>2</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>NumDecPlaces</answertest>
        <sans>ans3</sans>
        <tans>ta3</tans>
        <testoptions>2</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>827448424</deployedseed>
    <deployedseed>383748102</deployedseed>
    <deployedseed>1116459051</deployedseed>
    <deployedseed>11684950</deployedseed>
    <deployedseed>1520169543</deployedseed>
    <deployedseed>1153374356</deployedseed>
    <deployedseed>1951357202</deployedseed>
    <deployedseed>1243928523</deployedseed>
    <deployedseed>286879539</deployedseed>
    <deployedseed>882335080</deployedseed>
    <deployedseed>1354632150</deployedseed>
    <deployedseed>1062553353</deployedseed>
    <deployedseed>1139476830</deployedseed>
    <deployedseed>1405815329</deployedseed>
    <deployedseed>395938722</deployedseed>
    <deployedseed>1662765031</deployedseed>
    <deployedseed>2111064849</deployedseed>
    <deployedseed>1213988827</deployedseed>
    <deployedseed>765609320</deployedseed>
    <deployedseed>2095576753</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>dispdp(thA,2)</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>dispdp(ta2,2)</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>dispdp(ta3,2)</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>dispdp(ev(thA+1,simp),2)</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>dispdp(ev(ta2+1,simp),2)</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>dispdp(ev(ta3+1,simp),2)</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>
    <tags>
      <tag><text>jsxgraph</text>
</tag>
    </tags>
  </question>
</quiz>
