// Numbas version: exam_results_page_options {"name": "Tension in a cable", "extensions": ["geogebra", "quantities", "weh"], "custom_part_types": [{"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": [{"preamble": {"css": "", "js": "Numbas.extensions.weh.scope.ggbApplet.then(function(applet){applet.setValue('show',false)})\n"}, "variables": {"dperp": {"group": "Ungrouped variables", "name": "dperp", "description": "", "definition": "L sin(radians(alpha))", "templateType": "anything"}, "T": {"group": "Inputs", "name": "T", "description": "

Used when T is given.

", "definition": "qty(random(1..5)random(2,4,5,10),units[1])", "templateType": "anything"}, "debug": {"group": "Inputs", "name": "debug", "description": "", "definition": "false", "templateType": "anything"}, "direction": {"group": "Ungrouped variables", "name": "direction", "description": "", "definition": "if(A[0]>C[0],'clockwise','counterclockwise')", "templateType": "anything"}, "C": {"group": "Inputs", "name": "C", "description": "", "definition": "vector(random(0..24#4),random(0..32#4))", "templateType": "anything"}, "L": {"group": "Ungrouped variables", "name": "L", "description": "", "definition": "qty(abs(A),units[0])", "templateType": "anything"}, "A": {"group": "Inputs", "name": "A", "description": "", "definition": "vector(random(-28..28#4 except 0),random(8..28#4))", "templateType": "anything"}, "answers": {"group": "Inputs", "name": "answers", "description": "", "definition": "[['T', M/dperp], \n ['M', T*dperp]]\n\n", "templateType": "anything"}, "M": {"group": "Inputs", "name": "M", "description": "

Used when M is given.

", "definition": "qty(random(1..9)random(12, 24,36,48), units[0] + \" \" + units[1])\n", "templateType": "anything"}, "units": {"group": "Inputs", "name": "units", "description": "", "definition": "['in','lb']\n", "templateType": "anything"}, "version": {"group": "Inputs", "name": "version", "description": "

Which version?

", "definition": "random(0..1)", "templateType": "anything"}, "alpha": {"group": "Ungrouped variables", "name": "alpha", "description": "", "definition": "degrees(angle(-A,C-A))", "templateType": "anything"}}, "variable_groups": [{"variables": ["C", "A", "T", "M", "version", "answers", "debug", "units"], "name": "Inputs"}], "tags": ["Mechanics, statics, moment, 2-d, tension"], "parts": [{"sortAnswers": false, "showFeedbackIcon": true, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "type": "gapfill", "marks": 0, "showCorrectAnswer": true, "unitTests": [], "prompt": "

Knowing that the moment is {M} {direction}, determine the tension in the cable.

\n

Knowing that the tension in the cable is {T}, determine the magnitude of the moment M.

\n

\n
\n

\n

\n
", "scripts": {}, "variableReplacementStrategy": "originalfirst", "gaps": [{"variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "marks": "4", "scripts": {}, "type": "engineering-answer", "settings": {"C2": "50", "C1": "75", "C3": "25", "close": "1.0", "right": "0.2", "correctAnswer": "answers[version][1]"}, "showCorrectAnswer": true, "unitTests": []}]}], "metadata": {"description": "

Find the force required to produce a given moment, or vice-versa.

", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "name": "Tension in a cable", "extensions": ["geogebra", "quantities", "weh"], "functions": {}, "advice": "

Equate the applied moment \$M\$ to the moment produced by the force.

\n

\$\\Sigma M_B = 0 \\therefore M = F d_\\perp\$

\n

Use geometry to find \$d_\\perp\$ then solve for the unknown quantity.

", "ungrouped_variables": ["L", "alpha", "dperp", "direction"], "rulesets": {}, "statement": "

Control arm AB is subjected to a {direction} moment M and held in position by cable AC

\n

{geogebra_applet('msspdvgu',[['A',A],['C',C]])}

\n

", "variablesTest": {"condition": "abs(A) > 18 and abs(A-C) > 16 and abs(C) > 16", "maxRuns": 100}, "type": "question", "contributors": [{"name": "William Haynes", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2530/"}]}]}], "contributors": [{"name": "William Haynes", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2530/"}]}