<?xml version="1.0" encoding="UTF-8"?>
<quiz>
<!-- question: 88475  -->
  <question type="formulas">
    <name>
      <text>draw vector</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>Vector W has a magnitude of {w_given} and direction {theta360} degrees measured anti-clockwise from the positive x-axis.&nbsp;<span style="font-size: 0.9375rem;">Draw Vector W (black) using the tail-to-tip method.</span></p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.3333333</penalty>
    <hidden>0</hidden>
    <idnumber></idnumber>
    <correctfeedback format="html">
      <text>Your answer is correct.</text>
    </correctfeedback>
    <partiallycorrectfeedback format="html">
      <text>Your answer is partially correct.</text>
    </partiallycorrectfeedback>
    <incorrectfeedback format="html">
      <text>Your answer is incorrect.</text>
    </incorrectfeedback>
    <shownumcorrect/>
<varsrandom><text>r = shuffle([-15,-14,-13,-12,-11,11,12,13,14,15]);
</text>
</varsrandom>
<varsglobal><text><![CDATA[wx_answer = r[0];
wy_answer = r[1];

# Graph
wx = wx_answer;
wy = wy_answer;
u = wx_answer;
v = wy_answer;

# Given
w_given = round(sqrt(wx**2+wy**2),1);
theta = round(180*atan(wy/wx)/pi(),1);
theta360 = wx > 0 ? theta : theta+180;]]></text>
</varsglobal>
<answernumbering><text>none</text>
</answernumbering>
<answers>
 <partindex>
  <text>0</text>
 </partindex>
 <placeholder>
  <text></text>
 </placeholder>
 <answermark>
  <text>1</text>
 </answermark>
 <answertype>
  <text>0</text>
 </answertype>
 <numbox>
  <text>2</text>
 </numbox>
 <vars1>
  <text></text>
 </vars1>
 <answer>
  <text>[wx,wy]</text>
 </answer>
 <vars2>
  <text></text>
 </vars2>
 <correctness>
  <text><![CDATA[_relerr < 0.01]]></text>
 </correctness>
 <unitpenalty>
  <text>1</text>
 </unitpenalty>
 <postunit>
  <text></text>
 </postunit>
 <ruleid>
  <text>1</text>
 </ruleid>
 <otherrule>
  <text></text>
 </otherrule>
 <subqtext format="html">
<text><![CDATA[<jsxgraph width="400" height="400" ext_formulas="">

    // JavaScript code to create the construction.
    var jsxCode = function (question) {

        // Import the initial y-coordinates of the four points from formulas
        var t1, t2;
        [t1, t2] = question.getAllValues(0, 0);

        // Initialize the construction
        var board = question.initBoard({
                axis:true,
                boundingbox: [-17,17,17,-17],
                showCopyright: true,
                showNavigation: false
            });

board.create('text', [15,2,'X'], {visible:1, fixed:1});
board.create('text', [1,15,'Y'], {visible:1, fixed:1});

        var ox = board.create('line',[[0,0],[10,0]],{visible:false});
        var oy = board.create('line',[[0,0],[0,10]],{visible:false});
    
        // The four points fixated to the lines, called 'gliders'.
        var point_attr = {fixed: question.isSolved, snapToGrid: true, withLabel: false},
            p = [];
        p.push(board.create('glider', [t1,0,ox], {fixed: question.isSolved, snapToGrid: true, withLabel: false, name:'w_x'}));
        p.push(board.create('glider', [0,t2,oy], {fixed: question.isSolved, snapToGrid: true, withLabel: false, name:'w_y'}));
        board.create('arrow',[ [0,0], [()=&gt;{return p[0].X()}, ()=&gt;{return p[1].Y()} ] ],{name:'W',fixed:1});

       board.create('segment',[ [ ()=&gt;{return p[0].X()} ,0] , [()=&gt;{return p[0].X()}, ()=&gt;{return p[1].Y()} ] ],{fixed:1,dash:1});
       board.create('segment',[ [0, ()=&gt;{return p[1].Y()}] ,  [()=&gt;{return p[0].X()}, ()=&gt;{return p[1].Y()} ] ],{fixed:1,dash:1});

        board.update();

        // Whenever the construction is altered the values of the points are sent to formulas.
        question.bindInput(0, () =&gt; { return p[0].X(); });
        question.bindInput(1, () =&gt; { return p[1].Y(); });

    };

    // Execute the JavaScript code.
    new JSXQuestion(BOARDID, jsxCode);

</jsxgraph>]]></text>
 </subqtext>
 <feedback format="html">
<text></text>
 </feedback>
 <correctfeedback format="html">
<text></text>
 </correctfeedback>
 <partiallycorrectfeedback format="html">
<text></text>
 </partiallycorrectfeedback>
 <incorrectfeedback format="html">
<text></text>
 </incorrectfeedback>
</answers>
  </question>

</quiz>