// Numbas version: exam_results_page_options {"name": "Find magnitude and direction of three vectors", "extensions": ["geogebra", "quantities", "weh"], "custom_part_types": [{"source": {"pk": 12, "author": {"name": "William Haynes", "pk": 2530}, "edit_page": "/part_type/12/edit"}, "name": "Angle quantity 2020", "short_name": "angle", "description": "

Adjusts all angles to 0< $\\theta$ < 360.

\n

Accepts '°' and 'deg' as units.

\n

Penalizes if not close enough or no units.

\n

90° = -270° = 450°

numeric part of students answer, which is a quantity.

", "definition": "matchnumber(studentAnswer,['plain','en'])[1]"}], "settings": [{"name": "expected_answer", "label": "Expected Answer", "help_url": "", "hint": "Expected angle as a quantity.", "input_type": "code", "default_value": "qty(30,'deg')", "evaluate": true}, {"name": "unit_penalty", "label": "Unit penalty", "help_url": "", "hint": "Penalty for not including degree sign or 'deg'.", "input_type": "percent", "default_value": "20"}, {"name": "close_penalty", "label": "Close Penalty", "help_url": "", "hint": "Penalty for close answer.", "input_type": "percent", "default_value": "20"}, {"name": "close_tol", "label": "Close", "help_url": "", "hint": "Angle must be $\\pm$ this many degrees to be marked close.   ", "input_type": "code", "default_value": "0.5", "evaluate": false}, {"name": "right_tol", "label": "Right ", "help_url": "", "hint": "Angle must be $\\pm$ this many degrees to be marked correct.  ", "input_type": "code", "default_value": "0.1", "evaluate": false}], "public_availability": "restricted", "published": false, "extensions": ["quantities"]}, {"source": {"pk": 19, "author": {"name": "William Haynes", "pk": 2530}, "edit_page": "/part_type/19/edit"}, "name": "Engineering Accuracy with units", "short_name": "engineering-answer", "description": "

A value with units marked right if within an adjustable % error of the correct value.  Marked close if within a wider margin of error.

Does clumsy substitution to

\n

1. replace '-' with ' '

\n

2. replace '°' with ' deg'

\n

to allow answers like 10 ft-lb and 30°

", "name": "student_units"}, {"definition": "try(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n", "description": "", "name": "good_units"}, {"definition": "switch(not good_units, \n student_scalar * correct_units, \n not right_sign,\n -quantity(student_scalar, student_units),\n quantity(student_scalar,student_units)\n)\n \n", "description": "

This fixes the student answer for two common errors.

\n

If student_units are wrong  - replace with correct units

\n

If student_scalar has the wrong sign - replace with right sign

\n

If student makes both errors, only one gets fixed.

", "name": "student_quantity"}, {"definition": "try(\nscalar(abs((correct_quantity - student_quantity)/correct_quantity))*100 \n,msg,\nif(student_quantity=correct_quantity,0,100))\n ", "description": "", "name": "percent_error"}, {"definition": "percent_error <= settings['right']\n", "description": "", "name": "right"}, {"definition": "right_sign and percent_error <= settings['close']", "description": "

Only marked close if the student actually has the right sign.

", "name": "close"}, {"definition": "sign(student_scalar) = sign(correct_quantity) ", "description": "", "name": "right_sign"}], "settings": [{"input_type": "code", "evaluate": true, "hint": "The correct answer given as a JME quantity.", "default_value": "", "label": "Correct Quantity.", "help_url": "", "name": "correctAnswer"}, {"input_type": "code", "evaluate": true, "hint": "Question will be considered correct if the scalar part of the student's answer is within this % of correct value.", "default_value": "0.2", "label": "% Accuracy for right.", "help_url": "", "name": "right"}, {"input_type": "code", "evaluate": true, "hint": "Question will be considered close if the scalar part of the student's answer is within this % of correct value.", "default_value": "1.0", "label": "% Accuracy for close.", "help_url": "", "name": "close"}, {"input_type": "percent", "hint": "Partial Credit for close value with appropriate units.  if correct answer is 100 N and close is ±1%,
99  N is accepted.", "default_value": "75", "label": "Close with units.", "help_url": "", "name": "C1"}, {"input_type": "percent", "hint": "Partial credit for forgetting units or using wrong sign.
If the correct answer is 100 N, both 100 and -100 N are accepted.", "default_value": "50", "label": "No units or wrong sign", "help_url": "", "name": "C2"}, {"input_type": "percent", "hint": "Partial Credit for close value but forgotten units.
This value would be close if the expected units were provided.  If the correct answer is 100 N, and close is ±1%,
99 is accepted.", "default_value": "25", "label": "Close, no units.", "help_url": "", "name": "C3"}], "public_availability": "restricted", "published": false, "extensions": ["quantities"]}], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Find magnitude and direction of three vectors", "tags": [], "metadata": {"description": "

Given three vectors with integer components, find the corresponding magnitude and direction.

", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "statement": "

Three forces, A, B, and C are drawn to scale of 1 square = {scale} {units[1]}.  Find the magnitude and direction of each.

\n

{geogebra_applet('qdbwtfa9', [['fa',FA],['fb',FB],['fc',FC]])}

\n

For force $\\textbf{A}$

\n

$A = \\sqrt{{A_x}^2 + {A_y}^2} = \\sqrt{\\var{FA[0]}^2 +\\var{FA[1]}^2}$ = {siground(mag_A,4)}

\n

$\\theta_A = \\tan^{-1}\\left(\\left|\\dfrac{A_y}{A_x}\\right|\\right) = \\tan^{-1}\\left(\\left|\\dfrac{\\var{FA[1]}}{\\var{FA[0]}}\\right|\\right) =\\var{siground(degrees(arctan(abs(FA[1]/FA[0]))),4)}°$

\n

and similarly for $\\textbf{B}$ and $\\textbf{C}$.

", "rulesets": {}, "extensions": ["geogebra", "quantities", "weh"], "variables": {"FC": {"name": "FC", "group": "Inputs", "definition": "vector(random(-5..5 except 0),random(-5..5 except 0))", "description": "", "templateType": "anything"}, "scale": {"name": "scale", "group": "Inputs", "definition": "random(0.1,0.25,0.5,2,4,5,10,20)", "description": "", "templateType": "anything"}, "ref": {"name": "ref", "group": "Ungrouped variables", "definition": "0", "description": "

placeholder for reference axis

", "templateType": "anything"}, "theta_b": {"name": "theta_b", "group": "Outputs", "definition": "degrees(atan2(FB[1],FB[0]))", "description": "", "templateType": "anything"}, "c_from_ref": {"name": "c_from_ref", "group": "Ungrouped variables", "definition": "let(ang,theta_c,\n[if(ang>180,ang-360,ang),\nif(ang>270,ang-450,if(ang < -90,ang+270,ang-90)),\nif(ang>0,ang-180,ang+180),\nif(ang>90,ang-270,90+ang)])\n", "description": "", "templateType": "anything"}, "theta_a": {"name": "theta_a", "group": "Outputs", "definition": "mod(degrees(atan2(FA[1],FA[0])),360)", "description": "", "templateType": "anything"}, "C1": {"name": "C1", "group": "Inputs", "definition": "vector(5,0)\n", "description": "

Position of point C

", "templateType": "anything"}, "b_from_ref": {"name": "b_from_ref", "group": "Ungrouped variables", "definition": "let(ang,theta_b,\n[if(ang>180,ang-360,ang),\nif(ang>270,ang-450,if(ang < -90,ang+270,ang-90)),\nif(ang>0,ang-180,ang+180),\nif(ang>90,ang-270,90+ang)])\n", "description": "", "templateType": "anything"}, "A1": {"name": "A1", "group": "Inputs", "definition": "vector(-5,0)", "description": "

Position of point A  (start point for force A)  fixed in this problem

", "templateType": "anything"}, "mag_c": {"name": "mag_c", "group": "Outputs", "definition": "qty(abs(FC),units[1]) scale", "description": "", "templateType": "anything"}, "mag_a": {"name": "mag_a", "group": "Outputs", "definition": "qty(abs(FA),units[1]) scale", "description": "", "templateType": "anything"}, "debug": {"name": "debug", "group": "Inputs", "definition": "true", "description": "", "templateType": "anything"}, "theta_c": {"name": "theta_c", "group": "Outputs", "definition": "degrees(atan2(FC[1],FC[0]))", "description": "", "templateType": "anything"}, "a_from_ref": {"name": "a_from_ref", "group": "Ungrouped variables", "definition": "let(ang,theta_a,\n[if(ang>180,ang-360,ang),\nif(ang>270,ang-450,if(ang < -90,ang+270,ang-90)),\nif(ang>0,ang-180,ang+180),\nif(ang>90,ang-270,90+ang)])", "description": "", "templateType": "anything"}, "units": {"name": "units", "group": "Inputs", "definition": "random(['ft','lb'],['in','lb'],['cm','N'])", "description": "", "templateType": "anything"}, "FA": {"name": "FA", "group": "Inputs", "definition": "vector(random(-5..5 except 0),random(-5..5))", "description": "", "templateType": "anything"}, "FB": {"name": "FB", "group": "Inputs", "definition": "vector(random(-5..5),random(-5..5 except 0))", "description": "", "templateType": "anything"}, "mag_b": {"name": "mag_b", "group": "Outputs", "definition": "qty(abs(FB),units[1]) scale", "description": "", "templateType": "anything"}, "B1": {"name": "B1", "group": "Inputs", "definition": "vector(0,0)\n", "description": "

Position of point B

Find the magnitude and direction of A.

\n

$A$ = [[3]]

\n

$\\theta_A$ = [[0]] measured [[1]] from the  [[2]].

\n

magnitude = {siground(mag_A,4)}

\n

direction={theta_A}

\n

Find the magnitude and direction of B.

\n

$B$ = [[3]]

\n

$\\theta_B$ = [[0]] measured [[1]] from the [[2]].

\n

magnitude = {siground(mag_B,4)}

\n

direction={theta_B}

Find the magnitude and direction of C.

\n

$C$ = [[3]]

\n

$\\theta_C$ = [[0]] measured [[1]] from the  [[2]].

\n

magnitude = {siground(mag_C,4)}

\n

direction={theta_C} {C_from_ref}