// Numbas version: exam_results_page_options {"name": "Sine and Cosine rules", "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"]}, {"source": {"pk": 24, "author": {"name": "William Haynes", "pk": 2530}, "edit_page": "/part_type/24/edit"}, "name": "Angle quantity", "short_name": "angle-quantity-from-reference", "description": "

Angle as a quantity in degrees.

Solve a random oblique triangle for sides and angles.

"}, "extensions": ["geogebra", "quantities", "weh"], "type": "question", "statement": "

Determine the lengths of the three sides and the measures of the three angles for the case when A = ({A[0]},{A[1]}), B = ({B[0]},{B[1]}), C = ({C[0]},{C[1]}).  Length units are {units}.

\n

Give numeric answers to engineering accuracy and measure angles in degrees.

\n

{geogebra_applet('HCFekBp8',[['A',A],['B',B],['C',C]])}

\n

\n
\n

AB: {AB}  BC: {BC} CA: {CA}

\n

alpha: {alpha} beta: {beta} gamma: {gamma}

\n
", "variable_groups": [{"name": "Inputs", "variables": ["A", "B", "C", "units"]}, {"name": "results", "variables": ["AB", "BC", "CA", "alpha", "beta", "gamma", "sum"]}], "preamble": {"js": "\n\n\n\u00a0", "css": ""}, "variables": {"alpha": {"name": "alpha", "templateType": "anything", "group": "results", "description": "", "definition": "degrees(angle((B-A,C-A)))"}, "sum": {"name": "sum", "templateType": "anything", "group": "results", "description": "", "definition": "alpha+beta+gamma"}, "CA": {"name": "CA", "templateType": "anything", "group": "results", "description": "", "definition": "length(C-A)"}, "gamma": {"name": "gamma", "templateType": "anything", "group": "results", "description": "", "definition": "degrees(angle((A-C,B-C)))"}, "AB": {"name": "AB", "templateType": "anything", "group": "results", "description": "", "definition": "length(A-B)"}, "B": {"name": "B", "templateType": "anything", "group": "Inputs", "description": "", "definition": "vector(random(-8..8),random(-6..6))"}, "units": {"name": "units", "templateType": "anything", "group": "Inputs", "description": "", "definition": "random('m','ft','in','cm')"}, "BC": {"name": "BC", "templateType": "anything", "group": "results", "description": "", "definition": "length(B-C)"}, "A": {"name": "A", "templateType": "anything", "group": "Inputs", "description": "", "definition": "vector(random(-8..8),random(-6..6))"}, "C": {"name": "C", "templateType": "anything", "group": "Inputs", "description": "", "definition": "vector(random(-8..8),random(-6..6))"}, "beta": {"name": "beta", "templateType": "anything", "group": "results", "description": "", "definition": "degrees(angle((C-B,A-B)))"}}, "tags": ["mechanics, statics, trigonometry, law of sines, law of cosines"], "parts": [{"variableReplacements": [], "extendBaseMarkingAlgorithm": true, "useCustomName": false, "type": "gapfill", "gaps": [{"variableReplacements": [], "settings": {"correctAnswer": "quantity(AB,units)", "C1": "75", "right": "0.1", "C2": "50", "close": "1.0", "C3": "25"}, "type": "engineering-answer", "useCustomName": false, "showCorrectAnswer": true, "customName": "", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "customMarkingAlgorithm": "", "unitTests": [], "scripts": {}, "extendBaseMarkingAlgorithm": true, "marks": "4"}, {"variableReplacements": [], "settings": {"correctAnswer": "quantity(BC,units)", "C1": "75", "right": "0.1", "C2": "50", "close": "1.0", "C3": "25"}, "type": "engineering-answer", "useCustomName": false, "showCorrectAnswer": true, "customName": "", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "customMarkingAlgorithm": "", "unitTests": [], "scripts": {}, "extendBaseMarkingAlgorithm": true, "marks": "4"}, {"variableReplacements": [], "settings": {"correctAnswer": "quantity(CA,units)", "C1": "75", "right": "0.1", "C2": "50", "close": "1.0", "C3": "25"}, "type": "engineering-answer", "useCustomName": false, "showCorrectAnswer": true, "customName": "", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "customMarkingAlgorithm": "", "unitTests": [], "scripts": {}, "extendBaseMarkingAlgorithm": true, "marks": "4"}], "showCorrectAnswer": true, "customName": "", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "prompt": "

The lengths of the three sides are:

\n
\n
• AB = [[0]]
• \n
• BC = [[1]]
• \n
• CA = [[2]]
• \n
", "unitTests": [], "sortAnswers": false, "scripts": {}, "customMarkingAlgorithm": "", "marks": 0}, {"variableReplacements": [], "extendBaseMarkingAlgorithm": true, "useCustomName": false, "type": "gapfill", "gaps": [{"variableReplacements": [], "settings": {"correct_quantity": "qty(alpha,'deg')", "C1": "75", "right": "0.2", "restrict_angle": false, "close": "1.0", "C2": "50", "C3": "25"}, "type": "angle-quantity-from-reference", "useCustomName": false, "showCorrectAnswer": true, "customName": "", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "customMarkingAlgorithm": "", "unitTests": [], "scripts": {}, "extendBaseMarkingAlgorithm": true, "marks": "4"}, {"variableReplacements": [], "settings": {"correct_quantity": "qty(beta,'deg')", "C1": "75", "right": "0.2", "restrict_angle": false, "close": "1.0", "C2": "50", "C3": "25"}, "type": "angle-quantity-from-reference", "useCustomName": false, "showCorrectAnswer": true, "customName": "", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "customMarkingAlgorithm": "", "unitTests": [], "scripts": {}, "extendBaseMarkingAlgorithm": true, "marks": "4"}, {"variableReplacements": [], "settings": {"correct_quantity": "qty(gamma,'deg')", "C1": "75", "right": "0.2", "restrict_angle": false, "close": "1.0", "C2": "50", "C3": "25"}, "type": "angle-quantity-from-reference", "useCustomName": false, "showCorrectAnswer": true, "customName": "", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "customMarkingAlgorithm": "", "unitTests": [], "scripts": {}, "extendBaseMarkingAlgorithm": true, "marks": "4"}], "showCorrectAnswer": true, "customName": "", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "prompt": "

The three angles are:

\n
\n
• $\\alpha$ = [[0]]
• \n
• $\\beta$ = [[1]]
• \n
• $\\gamma$ = [[2]]
• \n
", "unitTests": [], "sortAnswers": false, "scripts": {}, "customMarkingAlgorithm": "", "marks": 0}], "variablesTest": {"condition": "(alpha > 15) and (beta > 15) and (gamma > 15) and (alpha <> 90) and (beta <> 90) and (gamma <>90)", "maxRuns": "200"}, "advice": "
\n
1. Use the distance formula to find the lengths of the three sides.
2. \n
3. Use the Law of Cosines to find one of the angles.
4. \n
5. Use the Law of Sines to find the other two angles.  Beware of the ambiguous case.  Check your answers against the diagram.
6. \n
", "functions": {}, "rulesets": {}, "ungrouped_variables": [], "contributors": [{"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}, {"name": "William Haynes", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2530/"}]}]}], "contributors": [{"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}, {"name": "William Haynes", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2530/"}]}