// Numbas version: finer_feedback_settings {"name": "Design Safety 2", "extensions": [], "custom_part_types": [{"source": {"pk": 1, "author": {"name": "Christian Lawson-Perfect", "pk": 7}, "edit_page": "/part_type/1/edit"}, "name": "Yes/no", "short_name": "yes-no", "description": "

The student is shown two radio choices: \"Yes\" and \"No\". One of them is correct.

", "help_url": "", "input_widget": "radios", "input_options": {"correctAnswer": "if(eval(settings[\"correct_answer_expr\"]), 0, 1)", "hint": {"static": true, "value": ""}, "choices": {"static": true, "value": ["Yes", "No"]}}, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\nif(studentanswer=correct_answer,\n correct(),\n incorrect()\n)\n\ninterpreted_answer:\nstudentAnswer=0\n\ncorrect_answer:\nif(eval(settings[\"correct_answer_expr\"]),0,1)", "marking_notes": [{"name": "mark", "description": "This is the main marking note. It should award credit and provide feedback based on the student's answer.", "definition": "if(studentanswer=correct_answer,\n correct(),\n incorrect()\n)"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "studentAnswer=0"}, {"name": "correct_answer", "description": "", "definition": "if(eval(settings[\"correct_answer_expr\"]),0,1)"}], "settings": [{"name": "correct_answer_expr", "label": "Is the answer \"Yes\"?", "help_url": "", "hint": "An expression which evaluates to true or false.", "input_type": "mathematical_expression", "default_value": "true", "subvars": false}], "public_availability": "always", "published": true, "extensions": []}], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Design Safety 2", "tags": [], "metadata": {"description": "

Question requires students to determine if the smallest angle of a triangle is smaller than a given value. Answer is Yes/No but students need to use cosine rule to find the smallest angle and to know that smallest angle is oppositeshortest side (otherwise they will need to find all angles of the triangle). Designed for a test where students upload handwritten working for each question as a check against guessing. Also designed to make it difficult for students to google or use AI to find the answer.

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

Note that the smallest angle in a triange is always opposite the shortest side of the triangle.

\n

Letting the shortest side be \\(a\\), and the smallest angle correspondingly \\(A\\) we have that \\(a=\\var{short}\\) m and, by the cosine rule \\[\\cos A=\\frac{b^2+c^2-a^2}{2bc}\\] where \\(b\\) and \\(c\\) are the lengths of the other two sides of the triangle.

\n

Thus

\n

\\begin{align}\\cos A&=\\frac{b^2+c^2-a^2}{2bc}\\\\&=\\frac{\\var{side2}^2+\\var{side3}^2-\\var{short}^2}{2\\times\\var{side2}\\times\\var{side3}}\\\\&=\\frac{\\var{side2^2}+\\var{side3^2}-\\var{short^2}}{\\var{2*side2*side3}}\\\\&\\approx\\var{cos_a}\\end{align}

\n

giving \\begin{align}A&=\\cos^{-1}\\left(\\var{cos_a}\\right)\\\\&\\approx\\var{ precround(angle,1)}^\\circ\\end{align}

\n

Hence the structure is safe.

\n

Hence the structure is not safe.

\n

 

", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"short": {"name": "short", "group": "Ungrouped variables", "definition": "random(3..5 #0.1)", "description": "

Length of shortest side of triangle

", "templateType": "anything", "can_override": false}, "side2": {"name": "side2", "group": "Ungrouped variables", "definition": "random(short+0.1..10 #0.1)", "description": "

length of second side of triangle - random but set to be greater than shortest side

", "templateType": "anything", "can_override": false}, "side3": {"name": "side3", "group": "Ungrouped variables", "definition": "random(short+0.1..short+side2-0.1 #0.1 except side2)", "description": "

length of third side of triangle, random but depends on lenghts of other 2 sides

", "templateType": "anything", "can_override": false}, "sides": {"name": "sides", "group": "Ungrouped variables", "definition": "shuffle([short, side2, side3])", "description": "

lengths of sides of traingles in shuffled order to ensure that the shortest side can appear as any of the specified sides in the question.

", "templateType": "anything", "can_override": false}, "angle": {"name": "angle", "group": "Ungrouped variables", "definition": "arccos((side2^2+side3^2-short^2)/(2*side2*side3))*180/pi", "description": "

smallest angle of the triangle in degrees

", "templateType": "anything", "can_override": false}, "cos_a": {"name": "cos_a", "group": "Ungrouped variables", "definition": "precround((side2^2+side3^2-short^2)/(2*side2*side3),4)", "description": "

cosine of smallest angle. used in Advice only.

", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "cos_a<1", "maxRuns": "200"}, "ungrouped_variables": ["short", "side2", "side3", "sides", "angle", "cos_a"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "yes-no", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

A building design requires a triangular support structure as part of its design. The plans show this structure as having sides of length \\(\\var{sides[0]}\\) m, \\(\\var{sides[1]}\\) m and \\(\\var{sides[2]}\\) m. Analysis of the design shows that the structure will be unsafe if the smallest angle of the triangle is less than \\(30^\\circ\\).

\n

Is the structure as designed safe? (Full working to justify your answer must be shown on your handwritten working)

", "settings": {"correct_answer_expr": "angle>30"}}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question", "contributors": [{"name": "Don Shearman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/680/"}, {"name": "Merryn Horrocks", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4052/"}]}]}], "contributors": [{"name": "Don Shearman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/680/"}, {"name": "Merryn Horrocks", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4052/"}]}