// Numbas version: exam_results_page_options {"name": "Jo-Ann's copy of Area under a curve by integration", "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": [{"rulesets": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "metadata": {"description": "

Find roots and the area under a curve

", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "preamble": {"js": "", "css": ""}, "tags": [], "advice": "
\n
1. To find the point where the curve crosses the y-axis, set x = 0 and solve for y.
2. \n
3. To find the point where the curve crosses the positive x-axis, set y to zero and solve for x using the quadratic formula.
4. \n
5. To find the area under the curve, divide the shaded area into vertical differential strips where $dA = y\\, dx$ then integrate between the horizontal limits to find the area.
6. \n
\n

\\begin{align}A &= \\int dA \\\\&= \\int_0^a y\\,dx \\\\&= \\int_0^a(\\simplify[!noleadingminus,unitfactor]{{A} x^2 + {B} x + {C}})\\, dx\\\\& = \\left[ \\simplify[unitfactor,collectnumbers]{{A} x^3/3 + {B} x^2/3 + {C}x}\\right]_0^\\var{scalar(siground(root1,4))}\\\\&=\\var{siground(area,4)}\\end{align}

", "variables": {"root1": {"templateType": "anything", "description": "", "definition": "qty((-b - sqrt(b^2-4 a c))/(2 a),units)", "group": "Ungrouped variables", "name": "root1"}, "B": {"templateType": "anything", "description": "", "definition": "random(1..4)", "group": "Ungrouped variables", "name": "B"}, "A": {"templateType": "anything", "description": "", "definition": "random(-0.5..-2#0.5)", "group": "Ungrouped variables", "name": "A"}, "units": {"templateType": "anything", "description": "", "definition": "random('in','ft','mm','cm')", "group": "Ungrouped variables", "name": "units"}, "debug": {"templateType": "anything", "description": "", "definition": "false", "group": "Ungrouped variables", "name": "debug"}, "area": {"templateType": "anything", "description": "", "definition": "let(x,scalar(root1), qty(A x^3/3 + B x^2/2 + C x,units)) qty(units)", "group": "Ungrouped variables", "name": "area"}, "C": {"templateType": "anything", "description": "", "definition": "random(0..3)+0.5", "group": "Ungrouped variables", "name": "C"}}, "variable_groups": [], "ungrouped_variables": ["A", "B", "C", "root1", "area", "units", "debug"], "extensions": ["geogebra", "quantities", "weh"], "statement": "

Given the function $\\color{red}{y=\\simplify[!noleadingminus,unitfactor]{{A} x^2 + {B} x + {C}}}$, determine the area under the curve from the y-axis to the point where the curve crosses the positive x-axis.  The x- and y- coordinates are in [{units}]. You may not use a graphing calculator to solve this problem.

\n

{geogebra_applet('nuhzkzqp',[['a',A],['b',B],['c',C]])}

\n

\n

", "name": "Jo-Ann's copy of Area under a curve by integration", "functions": {}, "parts": [{"gaps": [{"settings": {"close": "1.0", "right": "0.2", "correctAnswer": "qty(C,units)", "C3": "25", "C2": "50", "C1": "75"}, "showFeedbackIcon": true, "scripts": {}, "showCorrectAnswer": true, "type": "engineering-answer", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst", "unitTests": [], "variableReplacements": [], "marks": "2"}, {"settings": {"close": "1.0", "right": "0.2", "correctAnswer": "root1", "C3": "25", "C2": "50", "C1": "75"}, "showFeedbackIcon": true, "scripts": {}, "showCorrectAnswer": true, "type": "engineering-answer", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst", "unitTests": [], "variableReplacements": [], "marks": "2"}], "scripts": {}, "type": "gapfill", "extendBaseMarkingAlgorithm": true, "marks": 0, "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "showCorrectAnswer": true, "customMarkingAlgorithm": "", "prompt": "

Determine the points where the curve crosses the axes.

\n

$h$ = [[0]] {qty(C,units)}

\n

$a$ = [[1]] {siground(root1,4)}

", "unitTests": [], "sortAnswers": false, "variableReplacements": []}, {"gaps": [{"settings": {"close": "1.0", "right": "0.2", "correctAnswer": "area", "C3": "25", "C2": "50", "C1": "75"}, "showFeedbackIcon": true, "scripts": {}, "showCorrectAnswer": true, "type": "engineering-answer", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst", "unitTests": [], "variableReplacements": [], "marks": "6"}], "scripts": {}, "type": "gapfill", "extendBaseMarkingAlgorithm": true, "marks": 0, "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "showCorrectAnswer": true, "customMarkingAlgorithm": "", "prompt": "

Set up and evaluate the integral equation below to find the area under the curve.

\n

\\begin{align} A &= \\int{dA}\\\\&=\\int_0^a y\\, dx \\\\ \\vdots\\end{align}

\n

$A$ = [[0]]  {siground(area,4)}

", "unitTests": [], "sortAnswers": false, "variableReplacements": []}], "type": "question", "contributors": [{"name": "Ann Smith", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2295/"}, {"name": "William Haynes", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2530/"}, {"name": "Jo-Ann Lyons", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2630/"}]}]}], "contributors": [{"name": "Ann Smith", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2295/"}, {"name": "William Haynes", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2530/"}, {"name": "Jo-Ann Lyons", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2630/"}]}