<?xml version="1.0" encoding="UTF-8"?>
<quiz>
<!-- question: 34896  -->
  <question type="formulas">
    <name>
      <text>Vector - Resolve F movable - xMax 5</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>Force F has a magnitude of {w_given} N and direction of {theta360} degrees measured anti-clockwise from the positive x-axis.</p>
<p>1. Calculate both components Fx and Fy of the given force.</p>
<p>2. Adjust F in the diagram below until its components Fx and Fy fit your calculated values.</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><![CDATA[<p>Your answer is correct.</p>]]></text>
    </correctfeedback>
    <partiallycorrectfeedback format="html">
      <text><![CDATA[<p>Your answer is partially correct.</p>]]></text>
    </partiallycorrectfeedback>
    <incorrectfeedback format="html">
      <text><![CDATA[<p>Your answer is incorrect.</p>]]></text>
    </incorrectfeedback>
    <shownumcorrect/>
<varsrandom><text>wx = {-5:-1:0.2, 1:5:0.2};
wy = {-5:-1:0.2, 1:5:0.2};</text>
</varsrandom>
<varsglobal><text><![CDATA[# For scaling the axis: x-max = scalingFACTOR*20
scalingFACTOR = 0.25;

# Calculate given values for the task
w_given = round(sqrt(wx**2+wy**2),2);
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[sum(map("<",map("abs", map("/",_d, _a)),0.02))/len(_a)]]></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[<span class=nolink>
<jsxgraph width="400" height="400" ext_formulas="">

    // JavaScript code to create the construction.
    var jsxCode = function (question) {
        // The scalingFactor (of the coordinate system) is read from the variable in Formulas question.
        // For scaling the axis: x-max = scalingFACTOR*20
        var FACTOR = {scalingFACTOR};
        var xMAX = 20*FACTOR;
        var xCOLOR = "#d07";
        var yCOLOR = "#00f";
        var wCOLOR = "#909";

        // Import the initial coordinates from formulas input field of this part: requires array with 2 answers
        // Array is stored in [x, y] and initialized with scaled values of [10,10] as default
        var x, y;
        [x, y] = question.getAllValues([10*FACTOR,10*FACTOR]);

        // Initialize the board with coordinate system
        var board = question.initBoard({
                axis:true,
                boundingbox: [-22*FACTOR,22*FACTOR,22*FACTOR,-22*FACTOR],
                showCopyright: false,
                showNavigation: false
            });
        board.create('text', [xMAX,2*FACTOR,'X'], {visible:true, fixed:true, fontSize:15});
        board.create('text', [1*FACTOR,xMAX,'Y'], {visible:true, fixed:true, fontSize:15});

        // Attributes for better graphic appearance of points, lines, vectors
        var w_attributes = {fixed:question.isSolved, showInfobox:false, color:wCOLOR, strokeWidth:4,
                            snapSizeX:FACTOR, snapSizeY:FACTOR, snapToGrid:true,
                            label:{position:'bot',autoPosition: true, offset:[10,10], color:wCOLOR, fontSize:15}};
        var x_attributes = {fixed:question.isSolved, snapToGrid: false, showInfobox:false, color:xCOLOR, strokeWidth:2, 
                            snapSizeX:FACTOR, snapSizeY:FACTOR, snapToGrid:true,
                            label:{position:'bot',autoPosition: true, offset:[10,10], color:xCOLOR, fontSize:15}};
        var y_attributes = {fixed:question.isSolved, snapToGrid: false, showInfobox:false, color:yCOLOR, strokeWidth:2,
                            snapSizeX:FACTOR, snapSizeY:FACTOR, snapToGrid:true,
                            label:{position:'bot',autoPosition: true, offset:[10,10], color:yCOLOR, fontSize:15}};

        //Create Points for the vectors
        var oP = board.create("point", [0,0], {fixed:true, visible:false});
        var W = board.create("point", [x,y], w_attributes);
        W.setLabel("");
        W.size(2);
        // Points WX and WY will be dependent on point W
        x = ()=>{return W.X()};
        y = ()=>{return W.Y()};
        var WX = board.create("point", [x,0], {visible:false});
        var WY = board.create("point", [0,y], {visible:false});

        // Create vectors
        var wx = board.create("arrow", [ oP, WX], x_attributes);
        var wy = board.create("arrow", [ oP, WY], y_attributes);
        var w  = board.create("arrow", [ oP, W ], w_attributes);
        wx.setLabel("Fx");
        wy.setLabel("Fy");       
        w.setLabel("F");

        // Create dashed lines
        var xLine = board.create("line", [[x,0], [x,y]], x_attributes);
        var yLine = board.create("line", [[0,y], [x,y]], y_attributes);
        xLine.dash(2);
        yLine.dash(2);
        
        // Update the board
        board.update();

        // Whenever the construction is altered the values of the points are sent to formulas.
        question.bindInput(0,x);
        question.bindInput(1,y);
    };

    // Execute the JavaScript code.
    new JSXQuestion(BOARDID, jsxCode);

</jsxgraph>
</span>]]></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>