// Numbas version: finer_feedback_settings {"name": "Chapter 7 Exercises", "metadata": {"description": "
End of chapter exercises for Engineering Statics: Open and Interactive
", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "duration": 0, "percentPass": 0, "showQuestionGroupNames": true, "shuffleQuestionGroups": false, "showstudentname": true, "question_groups": [{"name": "Centroids by Composite Area", "pickingStrategy": "all-ordered", "pickQuestions": 1, "questionNames": ["", "Shape with Hole", "Rectangles and Triangles"], "variable_overrides": [[], [], []], "questions": [{"name": "Centroid of parts", "extensions": ["geogebra", "quantities", "sheets"], "custom_part_types": [{"source": {"pk": 242, "author": {"name": "Christian Lawson-Perfect", "pk": 7}, "edit_page": "/part_type/242/edit"}, "name": "Spreadsheet", "short_name": "spreadsheet", "description": "An editable spreadsheet. Ranges of cells can be disabled, and you can specify ranges of cells to be marked. A cell is marked correct if its value is equal to the value in the expected answer spreadsheet.
", "help_url": "", "input_widget": "spread-sheet", "input_options": {"correctAnswer": "settings[\"correct_answer\"]", "hint": {"static": true, "value": ""}, "initial_sheet": {"static": false, "value": "disable_cells(settings[\"initial_sheet\"], settings[\"disable_ranges\"])"}}, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\nif(sum(mark_ranges)=0,\n incorrect(),\n apply(mark_ranges)\n)\n\ninterpreted_answer:\nstudentAnswer\n\nrange_cells:\nmap(parse_range(ref),ref,values(settings[\"mark_ranges\"]))\n\ntotal_cells:\nlen(flatten(range_cells))\n\nrange_weights:\nswitch(\n settings[\"marking_method\"]=\"per_cell\",\n map(len(r)/total_cells, r, range_cells),\n // otherwise, mark per range\n repeat(1/len(range_cells), len(range_cells))\n)\n\nmark_ranges:\nmap(\n let(\n range_credit,\n sum(map(\n let(\n correctCellString, correctAnswer[c],\n correctCellNumber, parsenumber(correctCellString, notation_styles),\n studentCellString, studentAnswer[c],\n studentCellNumber, parsenumber(studentCellString, notation_styles),\n award(\n 1/len(cells), \n switch(\n correctCellString=\"\",\n isnan(studentCellNumber) or studentCellString=\"\",\n isnan(correctCellNumber),\n lower(correctCellString) = lower(studentCellString)\n ,\n abs(studentCellNumber - if(isnan(correctCellNumber),0,correctCellNumber)) <= settings[\"tolerance\"]\n )\n )\n ),\n c,\n cells\n )),\n message,\n switch(\n range_credit=0,\n if(len(cells)=1, \"This entry is incorrect.\", \"All entries in this range are incorrect.\"),\n range_credit=1,\n if(len(cells)=1, \"This entry is correct.\", \"All entries in this range are correct.\"),\n //otherwise\n \"Some entries in this range are correct.\"\n ),\n assert(len(cells)=0, add_credit(range_credit*w, \"{name}: \"+message)); \n range_credit\n ),\n [cells,w,name],\n zip(range_cells, range_weights, keys(settings[\"mark_ranges\"]))\n)\n\nnotation_styles:\n[\"plain\",\"si-en\"]\n\ncorrectAnswer:\nsettings[\"correct_answer\"]", "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(sum(mark_ranges)=0,\n incorrect(),\n apply(mark_ranges)\n)"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "studentAnswer"}, {"name": "range_cells", "description": "For each range to be marked, the addresses of the cells in that range.
", "definition": "map(parse_range(ref),ref,values(settings[\"mark_ranges\"]))"}, {"name": "total_cells", "description": "The total number of cells to be marked. Cells in overlapping ranges will be counted once for each range they're in.
", "definition": "len(flatten(range_cells))"}, {"name": "range_weights", "description": "The weight of each range, as a proportion of the available credit.
", "definition": "switch(\n settings[\"marking_method\"]=\"per_cell\",\n map(len(r)/total_cells, r, range_cells),\n // otherwise, mark per range\n repeat(1/len(range_cells), len(range_cells))\n)"}, {"name": "mark_ranges", "description": "Mark each of the ranges specified by the question author.
", "definition": "map(\n let(\n range_credit,\n sum(map(\n let(\n correctCellString, correctAnswer[c],\n correctCellNumber, parsenumber(correctCellString, notation_styles),\n studentCellString, studentAnswer[c],\n studentCellNumber, parsenumber(studentCellString, notation_styles),\n award(\n 1/len(cells), \n switch(\n correctCellString=\"\",\n isnan(studentCellNumber) or studentCellString=\"\",\n isnan(correctCellNumber),\n lower(correctCellString) = lower(studentCellString)\n ,\n abs(studentCellNumber - if(isnan(correctCellNumber),0,correctCellNumber)) <= settings[\"tolerance\"]\n )\n )\n ),\n c,\n cells\n )),\n message,\n switch(\n range_credit=0,\n if(len(cells)=1, \"This entry is incorrect.\", \"All entries in this range are incorrect.\"),\n range_credit=1,\n if(len(cells)=1, \"This entry is correct.\", \"All entries in this range are correct.\"),\n //otherwise\n \"Some entries in this range are correct.\"\n ),\n assert(len(cells)=0, add_credit(range_credit*w, \"{name}: \"+message)); \n range_credit\n ),\n [cells,w,name],\n zip(range_cells, range_weights, keys(settings[\"mark_ranges\"]))\n)"}, {"name": "notation_styles", "description": "Accepted number notation styles for a value in an individual cell.
", "definition": "[\"plain\",\"si-en\"]"}, {"name": "correctAnswer", "description": "", "definition": "settings[\"correct_answer\"]"}], "settings": [{"name": "initial_sheet", "label": "Initial sheet", "help_url": "", "hint": "Aspreadsheet object giving the initial state of the sheet that the student should fill in.", "input_type": "code", "default_value": "", "evaluate": true}, {"name": "correct_answer", "label": "Correct answer", "help_url": "", "hint": "A spreadsheet object representing a correct answer to the part.", "input_type": "code", "default_value": "", "evaluate": true}, {"name": "disable_ranges", "label": "Ranges to disable", "help_url": "", "hint": "A list of cell or range references, denoting the cells that should not be editable.", "input_type": "code", "default_value": "[]", "evaluate": true}, {"name": "mark_ranges", "label": "Ranges to mark", "help_url": "", "hint": "A dictionary of cell or range references, mapping names to ranges of cells, denoting the cells that should be compared for equality with the expected answer.", "input_type": "code", "default_value": "dict()", "evaluate": true}, {"name": "marking_method", "label": "Marking method", "help_url": "", "hint": "", "input_type": "dropdown", "default_value": "per_cell", "choices": [{"value": "per_cell", "label": "Each cell has the same weight"}, {"value": "per_range", "label": "Each range has the same weight"}]}, {"name": "tolerance", "label": "Allowed margin of error", "help_url": "", "hint": "", "input_type": "code", "default_value": "0", "evaluate": true}], "public_availability": "always", "published": true, "extensions": ["sheets"]}], "resources": ["question-resources/centroids.png", "question-resources/centroids_3A0rXlj.png", "question-resources/centroids_zSOgoBb.png"], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "William Haynes", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2530/"}], "tags": [], "metadata": {"description": "Locate the centroid of a rectangle, triangle, and semi-circle on a coordinate grid.
", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "statement": "Fill the table with the coordinates of the centroids of the three shapes. Grid units are $[\\var{units}]$.
\n{applet}
\n{answer_table}
", "advice": "For a rectangle, the centroid is at the geometric center.
\nFor a right triangle, divide the base and height into thirds. The centroid is located at the intersection point nearest to the right angle.
\nFor a semicircle, the centroid is located on the axis of symmetry, a distance of $\\frac{4r}{3\\pi}$ from the straight edge.
\n\n
table filled with centroid coordinates
", "templateType": "anything", "can_override": false}, "dist": {"name": "dist", "group": "Ungrouped variables", "definition": "//(V) -> [siground(qty(V[0], units),3),siground(qty(V[1], units),3)]\n(V) -> [siground(V[0],3),siground(V[1],3)]", "description": "input vector, output rounded vector of quantities
", "templateType": "anything", "can_override": false}, "params": {"name": "params", "group": "inputs", "definition": "[['R_1',R1],['R_2',R2],['T_1',T1],['T_2',T2],['C_1',C1],['C_2',C2]]", "description": "", "templateType": "anything", "can_override": false}, "applet": {"name": "applet", "group": "inputs", "definition": "geogebra_applet('xjjm7qqr',params)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "(R1-R2)[0] >= 2 and (R1-R2)[1] >= 2 and \n(T1-T2)[0] >= 2 and (T1-T2)[1] >= 2 and \nC1<>C2 and abs(C1-C2) > 2\n\n", "maxRuns": "200"}, "ungrouped_variables": ["units", "RC", "TC", "CC", "debug", "centroid_table", "answer_table", "dist"], "variable_groups": [{"name": "inputs", "variables": ["R1", "R2", "T1", "T2", "C1", "C2", "params", "applet"]}], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "spreadsheet", "useCustomName": false, "customName": "", "marks": "30", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Don't include units in table values.
", "settings": {"initial_sheet": "centroid_table", "correct_answer": "answer_table", "disable_ranges": "[\"A1:C1\", \"A1:A4\"]", "mark_ranges": "[\"Rectangle\": \"B2:C2\", \"Triangle\": \"B3:C3\", \"Circle\": \"B4:C4\"]", "marking_method": "per_cell", "tolerance": "0.1"}}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "Centroid of a composite area: shape with hole", "extensions": ["geogebra", "quantities", "sheets"], "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.
", "help_url": "", "input_widget": "string", "input_options": {"correctAnswer": "siground(settings['correctAnswer'],4)", "hint": {"static": true, "value": ""}, "allowEmpty": {"static": true, "value": true}}, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\nswitch( \n right and good_units and right_sign, add_credit(1.0,'Correct.'),\n right and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\n right and right_sign and not good_units, add_credit(settings['C2'],'Correct value, but wrong or missing units.'),\n close and good_units, add_credit(settings['C1'],'Close.'),\n close and not good_units, add_credit(settings['C3'],'Answer is close, but wrong or missing units.'),\n incorrect('Wrong answer.')\n)\n\ninterpreted_answer:\nqty(student_scalar, student_units)\n\n\n\ncorrect_quantity:\nsettings[\"correctAnswer\"]\n\n\n\ncorrect_units:\nunits(correct_quantity)\n\n\nallowed_notation_styles:\n[\"plain\",\"en\"]\n\nmatch_student_number:\nmatchnumber(studentAnswer,allowed_notation_styles)\n\nstudent_scalar:\nmatch_student_number[1]\n\nstudent_units:\nreplace_regex('ohms','ohm',\n replace_regex('\u00b0', ' deg',\n replace_regex('-', ' ' ,\n studentAnswer[len(match_student_number[0])..len(studentAnswer)])),\"i\")\n\ngood_units:\ntry(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n\n\nstudent_quantity:\nswitch(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\n\npercent_error:\ntry(\nscalar(abs((correct_quantity - student_quantity)/correct_quantity))*100 \n,msg,\nif(student_quantity=correct_quantity,0,100))\n \n\nright:\npercent_error <= settings['right']\n\n\nclose:\nright_sign and percent_error <= settings['close']\n\nright_sign:\nsign(student_scalar) = sign(correct_quantity)", "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": "switch( \n right and good_units and right_sign, add_credit(1.0,'Correct.'),\n right and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\n right and right_sign and not good_units, add_credit(settings['C2'],'Correct value, but wrong or missing units.'),\n close and good_units, add_credit(settings['C1'],'Close.'),\n close and not good_units, add_credit(settings['C3'],'Answer is close, but wrong or missing units.'),\n incorrect('Wrong answer.')\n)"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "qty(student_scalar, student_units)\n\n"}, {"name": "correct_quantity", "description": "", "definition": "settings[\"correctAnswer\"]\n\n"}, {"name": "correct_units", "description": "", "definition": "units(correct_quantity)\n"}, {"name": "allowed_notation_styles", "description": "", "definition": "[\"plain\",\"en\"]"}, {"name": "match_student_number", "description": "", "definition": "matchnumber(studentAnswer,allowed_notation_styles)"}, {"name": "student_scalar", "description": "", "definition": "match_student_number[1]"}, {"name": "student_units", "description": "Modify the unit portion of the student's answer by
\n1. replacing \"ohms\" with \"ohm\" case insensitive
\n2. replacing '-' with ' '
\n3. replacing '°' with ' deg'
\nto allow answers like 10 ft-lb and 30°
", "definition": "replace_regex('ohms','ohm',\n replace_regex('\u00b0', ' deg',\n replace_regex('-', ' ' ,\n studentAnswer[len(match_student_number[0])..len(studentAnswer)])),\"i\")"}, {"name": "good_units", "description": "", "definition": "try(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n"}, {"name": "student_quantity", "description": "This fixes the student answer for two common errors.
\nIf student_units are wrong - replace with correct units
\nIf student_scalar has the wrong sign - replace with right sign
\nIf student makes both errors, only one gets fixed.
", "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"}, {"name": "percent_error", "description": "", "definition": "try(\nscalar(abs((correct_quantity - student_quantity)/correct_quantity))*100 \n,msg,\nif(student_quantity=correct_quantity,0,100))\n "}, {"name": "right", "description": "", "definition": "percent_error <= settings['right']\n"}, {"name": "close", "description": "Only marked close if the student actually has the right sign.
", "definition": "right_sign and percent_error <= settings['close']"}, {"name": "right_sign", "description": "", "definition": "sign(student_scalar) = sign(correct_quantity) "}], "settings": [{"name": "correctAnswer", "label": "Correct Quantity.", "help_url": "", "hint": "The correct answer given as a JME quantity.", "input_type": "code", "default_value": "", "evaluate": true}, {"name": "right", "label": "% Accuracy for right.", "help_url": "", "hint": "Question will be considered correct if the scalar part of the student's answer is within this % of correct value.", "input_type": "code", "default_value": "0.2", "evaluate": true}, {"name": "close", "label": "% Accuracy for close.", "help_url": "", "hint": "Question will be considered close if the scalar part of the student's answer is within this % of correct value.", "input_type": "code", "default_value": "1.0", "evaluate": true}, {"name": "C1", "label": "Close with units.", "help_url": "", "hint": "Partial Credit for close value with appropriate units. if correct answer is 100 N and close is ±1%,An editable spreadsheet. Ranges of cells can be disabled, and you can specify ranges of cells to be marked. A cell is marked correct if its value is equal to the value in the expected answer spreadsheet.
", "help_url": "", "input_widget": "spread-sheet", "input_options": {"correctAnswer": "settings[\"correct_answer\"]", "hint": {"static": true, "value": ""}, "initial_sheet": {"static": false, "value": "disable_cells(settings[\"initial_sheet\"], settings[\"disable_ranges\"])"}}, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\nif(sum(mark_ranges)=0,\n incorrect(),\n apply(mark_ranges)\n)\n\ninterpreted_answer:\nstudentAnswer\n\nrange_cells:\nmap(parse_range(ref),ref,values(settings[\"mark_ranges\"]))\n\ntotal_cells:\nlen(flatten(range_cells))\n\nrange_weights:\nswitch(\n settings[\"marking_method\"]=\"per_cell\",\n map(len(r)/total_cells, r, range_cells),\n // otherwise, mark per range\n repeat(1/len(range_cells), len(range_cells))\n)\n\nmark_ranges:\nmap(\n let(\n range_credit,\n sum(map(\n let(\n correctCellString, correctAnswer[c],\n correctCellNumber, parsenumber(correctCellString, notation_styles),\n studentCellString, studentAnswer[c],\n studentCellNumber, parsenumber(studentCellString, notation_styles),\n award(\n 1/len(cells), \n switch(\n correctCellString=\"\",\n isnan(studentCellNumber) or studentCellString=\"\",\n isnan(correctCellNumber),\n lower(correctCellString) = lower(studentCellString)\n ,\n abs(studentCellNumber - if(isnan(correctCellNumber),0,correctCellNumber)) <= settings[\"tolerance\"]\n )\n )\n ),\n c,\n cells\n )),\n message,\n switch(\n range_credit=0,\n if(len(cells)=1, \"This entry is incorrect.\", \"All entries in this range are incorrect.\"),\n range_credit=1,\n if(len(cells)=1, \"This entry is correct.\", \"All entries in this range are correct.\"),\n //otherwise\n \"Some entries in this range are correct.\"\n ),\n assert(len(cells)=0, add_credit(range_credit*w, \"{name}: \"+message)); \n range_credit\n ),\n [cells,w,name],\n zip(range_cells, range_weights, keys(settings[\"mark_ranges\"]))\n)\n\nnotation_styles:\n[\"plain\",\"si-en\"]\n\ncorrectAnswer:\nsettings[\"correct_answer\"]", "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(sum(mark_ranges)=0,\n incorrect(),\n apply(mark_ranges)\n)"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "studentAnswer"}, {"name": "range_cells", "description": "For each range to be marked, the addresses of the cells in that range.
", "definition": "map(parse_range(ref),ref,values(settings[\"mark_ranges\"]))"}, {"name": "total_cells", "description": "The total number of cells to be marked. Cells in overlapping ranges will be counted once for each range they're in.
", "definition": "len(flatten(range_cells))"}, {"name": "range_weights", "description": "The weight of each range, as a proportion of the available credit.
", "definition": "switch(\n settings[\"marking_method\"]=\"per_cell\",\n map(len(r)/total_cells, r, range_cells),\n // otherwise, mark per range\n repeat(1/len(range_cells), len(range_cells))\n)"}, {"name": "mark_ranges", "description": "Mark each of the ranges specified by the question author.
", "definition": "map(\n let(\n range_credit,\n sum(map(\n let(\n correctCellString, correctAnswer[c],\n correctCellNumber, parsenumber(correctCellString, notation_styles),\n studentCellString, studentAnswer[c],\n studentCellNumber, parsenumber(studentCellString, notation_styles),\n award(\n 1/len(cells), \n switch(\n correctCellString=\"\",\n isnan(studentCellNumber) or studentCellString=\"\",\n isnan(correctCellNumber),\n lower(correctCellString) = lower(studentCellString)\n ,\n abs(studentCellNumber - if(isnan(correctCellNumber),0,correctCellNumber)) <= settings[\"tolerance\"]\n )\n )\n ),\n c,\n cells\n )),\n message,\n switch(\n range_credit=0,\n if(len(cells)=1, \"This entry is incorrect.\", \"All entries in this range are incorrect.\"),\n range_credit=1,\n if(len(cells)=1, \"This entry is correct.\", \"All entries in this range are correct.\"),\n //otherwise\n \"Some entries in this range are correct.\"\n ),\n assert(len(cells)=0, add_credit(range_credit*w, \"{name}: \"+message)); \n range_credit\n ),\n [cells,w,name],\n zip(range_cells, range_weights, keys(settings[\"mark_ranges\"]))\n)"}, {"name": "notation_styles", "description": "Accepted number notation styles for a value in an individual cell.
", "definition": "[\"plain\",\"si-en\"]"}, {"name": "correctAnswer", "description": "", "definition": "settings[\"correct_answer\"]"}], "settings": [{"name": "initial_sheet", "label": "Initial sheet", "help_url": "", "hint": "Aspreadsheet object giving the initial state of the sheet that the student should fill in.", "input_type": "code", "default_value": "", "evaluate": true}, {"name": "correct_answer", "label": "Correct answer", "help_url": "", "hint": "A spreadsheet object representing a correct answer to the part.", "input_type": "code", "default_value": "", "evaluate": true}, {"name": "disable_ranges", "label": "Ranges to disable", "help_url": "", "hint": "A list of cell or range references, denoting the cells that should not be editable.", "input_type": "code", "default_value": "[]", "evaluate": true}, {"name": "mark_ranges", "label": "Ranges to mark", "help_url": "", "hint": "A dictionary of cell or range references, mapping names to ranges of cells, denoting the cells that should be compared for equality with the expected answer.", "input_type": "code", "default_value": "dict()", "evaluate": true}, {"name": "marking_method", "label": "Marking method", "help_url": "", "hint": "", "input_type": "dropdown", "default_value": "per_cell", "choices": [{"value": "per_cell", "label": "Each cell has the same weight"}, {"value": "per_range", "label": "Each range has the same weight"}]}, {"name": "tolerance", "label": "Allowed margin of error", "help_url": "", "hint": "", "input_type": "code", "default_value": "0", "evaluate": true}], "public_availability": "always", "published": true, "extensions": ["sheets"]}], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "William Haynes", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2530/"}], "tags": ["centroids", "composite area method", "mechanics", "Mechanics", "statics", "Statics"], "metadata": {"description": "Find the centroid of a shape made from a rectangle, triangle, and circle.
", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "statement": "{geogebra_applet('fcfsjuv9',[ ['A',A],['b_1',b1],['h_1',h1],['h_t',ht],['n',n],['Center',center],['radius',radius]])}
\nComplete the table below and detemine the coordinates of the centroid of the composite shape shown.
\nConsider the shape to be made up of a {if (m=1,'large','')} rectangle {if (m=0, 'plus a triangle', 'with a triangle removed')} with a {if(random(true,false), radius + \" \" + units + \" radius\" , 2 * radius + \" \" + units + \" diameter\")} circular hole centered at ({(center+A)[0]}, {(center+A)[1]}).
\n{table_add_q}
", "advice": "{geogebra_applet('fcfsjuv9',[ ['A',A],['b_1',b1],['h_1',h1],['h_t',ht],['n',n],['Center',center],['radius',radius],['visibility',m]])}
\n1. Divide the shape into three subshapes as described in the problem statement.
\n2. Know how to set up a table to collect the information, since it will not normally be provided.
\n3. Determine and enter the area and centroidal coordinates for each subshape into the table
\n$\\qquad A_i, \\bar{x}_i,\\bar{y}_i$
\n4. Multiply area by the centroidal coordinates to get the moment of areas for the pieces.
\n$\\qquad (Q_x)_i = A_i\\bar{y}_i ,\\quad(Q_y)_i=A_i\\bar{x}_i$.
\n5. Sum columns 3, 6 and 7 to find the total area and moments of area: $ A, Q_x, Q_y$
\n6. Find answers with
\n$\\qquad \\bar{x} = \\dfrac{Q_y}{A} =\\dfrac{\\Sigma A_i \\bar{x}_i}{\\Sigma A_i} = \\dfrac{\\var{siground(Q_total[1],3)}}{\\var{siground(area_total,3)}} = \\var{siground(centroid[0],3)}\\, \\var{units}$
\n$\\qquad \\bar{y} = \\dfrac{Q_x}{A} = \\dfrac{\\Sigma A_i \\bar{y}_i}{\\Sigma A_i}= \\dfrac{\\var{siground(Q_total[0],3)}}{\\var{siground(area_total,3)}}= \\var{siground(centroid[1],3)}\\, \\var{units} $
", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"ht": {"name": "ht", "group": "Input values", "definition": "random(3..9#3)", "description": "\"height\" of triangle
\nhorizontal for n = 4,5,6,10,11,12
\nvertical for n = 1,2,3,7,8,9
", "templateType": "anything", "can_override": false}, "C_rect": {"name": "C_rect", "group": "centroids", "definition": "[vector(b1/2,h1/2) + A,\n if(n in [1,2,3], vector(b1/2,(h1-ht)/2)+A,\n if(n in [4,5,6], vector((b1+ht)/2,h1/2)+A,\n if(n in [7,8,9], vector(b1/2,(h1+ht)/2)+A,\n vector((b1-ht)/2,h1/2)+A)))] ", "description": "", "templateType": "anything", "can_override": false}, "C_circ": {"name": "C_circ", "group": "centroids", "definition": "[center +A ,center +A]", "description": "", "templateType": "anything", "can_override": false}, "units": {"name": "units", "group": "Input values", "definition": "random('in', 'cm', 'ft' )", "description": "Offset of bottom right corner from originl
", "templateType": "anything", "can_override": false}, "area_circ": {"name": "area_circ", "group": "Calculated areas", "definition": "[- pi * radius^2, - pi* radius^2]", "description": "", "templateType": "anything", "can_override": false}, "area_total": {"name": "area_total", "group": "Calculated areas", "definition": "area_rect[0]+area_tri[0]+area_circ[0]", "description": "", "templateType": "anything", "can_override": false}, "area_tri": {"name": "area_tri", "group": "Calculated areas", "definition": "[if(n in [1,2,3,7,8,9], b1*ht/2,h1*ht/2),\n-if(n in [1,2,3,7,8,9], b1*ht/2,h1*ht/2)]", "description": "", "templateType": "anything", "can_override": false}, "center": {"name": "center", "group": "Input values", "definition": "vector(b1/2,h1/2) + random(0..3) *\nvector(if(n<=3,[0,-1],\nif(n<=6,[1,0],\nif(n<=9,[0,1],\n[-1,0]))))\n\n\n\n\n", "description": "center of the circle measured from bottom left of the rectangle
", "templateType": "anything", "can_override": false}, "Q_circ": {"name": "Q_circ", "group": "moments of area", "definition": "area_circ[m] * vector(C_circ[m][1],C_circ[m][0])", "description": "", "templateType": "anything", "can_override": false}, "radius": {"name": "radius", "group": "Input values", "definition": "random(1..(min(h1-1,b1-1)/2)#0.5)", "description": "radius of the circle
", "templateType": "anything", "can_override": false}, "A": {"name": "A", "group": "Input values", "definition": "-vector(random([0,0],[b1,0],[b1,h1],[0,h1],[b1/2,h1/2],[0,h1/2],[center[0],center[1]]))", "description": "This offsets the shape to one of the corners of the rect, the center of the rect, or the center of the circle.
", "templateType": "anything", "can_override": false}, "h1": {"name": "h1", "group": "Input values", "definition": "random(4..12#2)", "description": "vertical height of rectangle
", "templateType": "anything", "can_override": false}, "b1": {"name": "b1", "group": "Input values", "definition": "random(4..12#2)", "description": "horizontal base of rectangle
", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Input values", "definition": "random(1 .. 12#1)", "description": "Selects the position of the triangle, index gives vertex location
\n| \n | 9 | \n8 | \n7 | \n\n |
| 10 | \n\n | \n | \n | 6 | \n
| 11 | \n\n | rectangle | \n\n | 5 | \n
| 12 | \n\n | \n | \n | 4 | \n
| \n | 1 | \n2 | \n3 | \n\n |
determines location of centroid of triangle based on location and method
returns array of centroid coordinates, first term for m=0
This is the method used to solve the problem:
\nm=0: small rectangle + triangle - circle
\nm=1: big rectangle - triangle - circle
\nwhen n is in [2,5,8,11], use method 0, becauses otherwise it would require 2 negative triangles.
", "templateType": "anything", "can_override": false}, "Q_rect": {"name": "Q_rect", "group": "moments of area", "definition": "area_rect[m] * vector(C_rect[m][1],C_rect[m][0])", "description": "[Q_x,Q_y]
", "templateType": "anything", "can_override": false}, "area_rect": {"name": "area_rect", "group": "Calculated areas", "definition": "[b1*h1,if(n in [1,2,3,7,8,9],b1*(h1+ht),h1*(b1+ht))]", "description": "", "templateType": "anything", "can_override": false}, "centroid": {"name": "centroid", "group": "moments of area", "definition": "vector(Q_total[1]/area_total,Q_total[0]/area_total)", "description": "", "templateType": "anything", "can_override": false}, "Q_tri": {"name": "Q_tri", "group": "moments of area", "definition": "area_tri[m] * vector(C_tri[m][1],C_tri[m][0])", "description": "", "templateType": "anything", "can_override": false}, "Q_total": {"name": "Q_total", "group": "moments of area", "definition": "Q_rect+Q_tri+Q_circ", "description": "", "templateType": "anything", "can_override": false}, "blank_table": {"name": "blank_table", "group": "Ungrouped variables", "definition": "spreadsheet_from_base64_file(safe(\"centroid_table.xlsx\"), safe(\"UEsDBBQABgAIAAAAIQBi7p1oXgEAAJAEAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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EsBAi0AFAAGAAgAAAAhAJpweyw8AwAANwoAAA0AAAAAAAAAAAAAAAAARBgAAHhsL3N0eWxlcy54bWxQSwECLQAUAAYACAAAACEAXbj/S/QAAAD9AQAAFAAAAAAAAAAAAAAAAACrGwAAeGwvc2hhcmVkU3RyaW5ncy54bWxQSwECLQAUAAYACAAAACEA0kZRR0kBAABtAgAAEQAAAAAAAAAAAAAAAADRHAAAZG9jUHJvcHMvY29yZS54bWxQSwECLQAUAAYACAAAACEAwl5ZCJABAAAbAwAAEAAAAAAAAAAAAAAAAABRHwAAZG9jUHJvcHMvYXBwLnhtbFBLBQYAAAAACgAKAIACAAAXIgAAAAA=\"))", "description": "", "templateType": "spreadsheet", "can_override": false}, "params": {"name": "params", "group": "Ungrouped variables", "definition": "[ ['A',A],['b_1',b1],['h_1',h1],['h_t',ht],['n',n],['Center',center],['radius',radius]]", "description": "", "templateType": "anything", "can_override": false}, "applet": {"name": "applet", "group": "Ungrouped variables", "definition": "geogebra_applet('fcfsjuv9',params)", "description": "", "templateType": "anything", "can_override": false}, "table_add_centroids": {"name": "table_add_centroids", "group": "Ungrouped variables", "definition": "fill_range(table_add_areas, \"D2:E4\", map((x)->[siground(x[m][0],3),siground(x[m][1],3)], [C_rect,c_tri, c_circ]))", "description": "", "templateType": "anything", "can_override": false}, "table_add_areas": {"name": "table_add_areas", "group": "Ungrouped variables", "definition": "fill_range(blank_table,\"C2:C5\",map(v->siground(v[m],3), [area_rect,area_tri, area_circ])+ [precround(area_total,2)])\n", "description": "", "templateType": "anything", "can_override": false}, "table_add_q": {"name": "table_add_q", "group": "Ungrouped variables", "definition": "fill_range(table_add_centroids, \"F2:G5\", map((x)->[siground(x[1],3),siground(x[0],3)],[Q_rect,Q_tri,Q_circ])+ [list(precround(q_total,1))])", "description": "", "templateType": "anything", "can_override": false}, "debug": {"name": "debug", "group": "Ungrouped variables", "definition": "false", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "// tries to prevent the circle from extending beyond the perimiter.\n\nif (n<=3, center[1]-2*radius > -(h1+ht/2),\nif (n<=6, (center[0]+2*radius) < (b1+ht/2),\nif (n<=9, (center[1]+2*radius) < (h1+ht/2),\n (center[0]-2*radius) > -(b1-ht/2))))\n", "maxRuns": 100}, "ungrouped_variables": ["blank_table", "table_add_areas", "table_add_centroids", "table_add_q", "params", "applet", "debug"], "variable_groups": [{"name": "Input values", "variables": ["A", "b1", "h1", "ht", "center", "units", "radius", "n", "m"]}, {"name": "Calculated areas", "variables": ["area_rect", "area_tri", "area_circ", "area_total"]}, {"name": "centroids", "variables": ["C_rect", "C_circ", "C_tri"]}, {"name": "moments of area", "variables": ["Q_rect", "Q_tri", "Q_circ", "Q_total", "centroid"]}], "functions": {}, "preamble": {"js": "\n", "css": "table.centroid{margin-left:0;}\n\ntable.centroid td {\n width:6em; \n vertical-align:center; \n text-align:center;}\ntable.centroid *.underline {border-bottom: 2px solid black;}\n\n"}, "parts": [{"type": "spreadsheet", "useCustomName": true, "customName": "Centroid Table", "marks": "36", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "settings": {"initial_sheet": "blank_table", "correct_answer": "table_add_q", "disable_ranges": "[\"A1:B5\", \"A1:G1\", \"D5:E5\"]", "mark_ranges": "[\"$A_i$\": \"C2:C4\", \"$\\\\bar{x}_i$\": \"D2:D4\", \"$\\\\bar{y}_i$\": \"E2:E4\",\"$A_i\\\\bar{x}_i$\": \"F2:F4\", \"$A_i\\\\bar{y}_i$\": \"G2:G4\", \"$A$\": \"C5\", \"$Q_y$\": \"F5\",\"$Q_x$\": \"G5\"]", "marking_method": "per_cell", "tolerance": "0.05"}}, {"type": "gapfill", "useCustomName": true, "customName": "Centroid", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "$\\bar{x} =\\dfrac{Q_y}{A} = $ [[0]]
\n$\\bar{y} =\\dfrac{Q_x}{A} = $ [[1]]
A value with units marked right if within an adjustable % error of the correct value. Marked close if within a wider margin of error.
", "help_url": "", "input_widget": "string", "input_options": {"correctAnswer": "siground(settings['correctAnswer'],4)", "hint": {"static": true, "value": ""}, "allowEmpty": {"static": true, "value": true}}, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\nswitch( \n right and good_units and right_sign, add_credit(1.0,'Correct.'),\n right and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\n right and right_sign and not good_units, add_credit(settings['C2'],'Correct value, but wrong or missing units.'),\n close and good_units, add_credit(settings['C1'],'Close.'),\n close and not good_units, add_credit(settings['C3'],'Answer is close, but wrong or missing units.'),\n incorrect('Wrong answer.')\n)\n\ninterpreted_answer:\nqty(student_scalar, student_units)\n\n\n\ncorrect_quantity:\nsettings[\"correctAnswer\"]\n\n\n\ncorrect_units:\nunits(correct_quantity)\n\n\nallowed_notation_styles:\n[\"plain\",\"en\"]\n\nmatch_student_number:\nmatchnumber(studentAnswer,allowed_notation_styles)\n\nstudent_scalar:\nmatch_student_number[1]\n\nstudent_units:\nreplace_regex('ohms','ohm',\n replace_regex('\u00b0', ' deg',\n replace_regex('-', ' ' ,\n studentAnswer[len(match_student_number[0])..len(studentAnswer)])),\"i\")\n\ngood_units:\ntry(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n\n\nstudent_quantity:\nswitch(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\n\npercent_error:\ntry(\nscalar(abs((correct_quantity - student_quantity)/correct_quantity))*100 \n,msg,\nif(student_quantity=correct_quantity,0,100))\n \n\nright:\npercent_error <= settings['right']\n\n\nclose:\nright_sign and percent_error <= settings['close']\n\nright_sign:\nsign(student_scalar) = sign(correct_quantity)", "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": "switch( \n right and good_units and right_sign, add_credit(1.0,'Correct.'),\n right and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\n right and right_sign and not good_units, add_credit(settings['C2'],'Correct value, but wrong or missing units.'),\n close and good_units, add_credit(settings['C1'],'Close.'),\n close and not good_units, add_credit(settings['C3'],'Answer is close, but wrong or missing units.'),\n incorrect('Wrong answer.')\n)"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "qty(student_scalar, student_units)\n\n"}, {"name": "correct_quantity", "description": "", "definition": "settings[\"correctAnswer\"]\n\n"}, {"name": "correct_units", "description": "", "definition": "units(correct_quantity)\n"}, {"name": "allowed_notation_styles", "description": "", "definition": "[\"plain\",\"en\"]"}, {"name": "match_student_number", "description": "", "definition": "matchnumber(studentAnswer,allowed_notation_styles)"}, {"name": "student_scalar", "description": "", "definition": "match_student_number[1]"}, {"name": "student_units", "description": "Modify the unit portion of the student's answer by
\n1. replacing \"ohms\" with \"ohm\" case insensitive
\n2. replacing '-' with ' '
\n3. replacing '°' with ' deg'
\nto allow answers like 10 ft-lb and 30°
", "definition": "replace_regex('ohms','ohm',\n replace_regex('\u00b0', ' deg',\n replace_regex('-', ' ' ,\n studentAnswer[len(match_student_number[0])..len(studentAnswer)])),\"i\")"}, {"name": "good_units", "description": "", "definition": "try(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n"}, {"name": "student_quantity", "description": "This fixes the student answer for two common errors.
\nIf student_units are wrong - replace with correct units
\nIf student_scalar has the wrong sign - replace with right sign
\nIf student makes both errors, only one gets fixed.
", "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"}, {"name": "percent_error", "description": "", "definition": "try(\nscalar(abs((correct_quantity - student_quantity)/correct_quantity))*100 \n,msg,\nif(student_quantity=correct_quantity,0,100))\n "}, {"name": "right", "description": "", "definition": "percent_error <= settings['right']\n"}, {"name": "close", "description": "Only marked close if the student actually has the right sign.
", "definition": "right_sign and percent_error <= settings['close']"}, {"name": "right_sign", "description": "", "definition": "sign(student_scalar) = sign(correct_quantity) "}], "settings": [{"name": "correctAnswer", "label": "Correct Quantity.", "help_url": "", "hint": "The correct answer given as a JME quantity.", "input_type": "code", "default_value": "", "evaluate": true}, {"name": "right", "label": "% Accuracy for right.", "help_url": "", "hint": "Question will be considered correct if the scalar part of the student's answer is within this % of correct value.", "input_type": "code", "default_value": "0.2", "evaluate": true}, {"name": "close", "label": "% Accuracy for close.", "help_url": "", "hint": "Question will be considered close if the scalar part of the student's answer is within this % of correct value.", "input_type": "code", "default_value": "1.0", "evaluate": true}, {"name": "C1", "label": "Close with units.", "help_url": "", "hint": "Partial Credit for close value with appropriate units. if correct answer is 100 N and close is ±1%,An editable spreadsheet. Ranges of cells can be disabled, and you can specify ranges of cells to be marked. A cell is marked correct if its value is equal to the value in the expected answer spreadsheet.
", "help_url": "", "input_widget": "spread-sheet", "input_options": {"correctAnswer": "settings[\"correct_answer\"]", "hint": {"static": true, "value": ""}, "initial_sheet": {"static": false, "value": "disable_cells(settings[\"initial_sheet\"], settings[\"disable_ranges\"])"}}, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\nif(sum(mark_ranges)=0,\n incorrect(),\n apply(mark_ranges)\n)\n\ninterpreted_answer:\nstudentAnswer\n\nrange_cells:\nmap(parse_range(ref),ref,values(settings[\"mark_ranges\"]))\n\ntotal_cells:\nlen(flatten(range_cells))\n\nrange_weights:\nswitch(\n settings[\"marking_method\"]=\"per_cell\",\n map(len(r)/total_cells, r, range_cells),\n // otherwise, mark per range\n repeat(1/len(range_cells), len(range_cells))\n)\n\nmark_ranges:\nmap(\n let(\n range_credit,\n sum(map(\n let(\n correctCellString, correctAnswer[c],\n correctCellNumber, parsenumber(correctCellString, notation_styles),\n studentCellString, studentAnswer[c],\n studentCellNumber, parsenumber(studentCellString, notation_styles),\n award(\n 1/len(cells), \n switch(\n correctCellString=\"\",\n isnan(studentCellNumber) or studentCellString=\"\",\n isnan(correctCellNumber),\n lower(correctCellString) = lower(studentCellString)\n ,\n abs(studentCellNumber - if(isnan(correctCellNumber),0,correctCellNumber)) <= settings[\"tolerance\"]\n )\n )\n ),\n c,\n cells\n )),\n message,\n switch(\n range_credit=0,\n if(len(cells)=1, \"This entry is incorrect.\", \"All entries in this range are incorrect.\"),\n range_credit=1,\n if(len(cells)=1, \"This entry is correct.\", \"All entries in this range are correct.\"),\n //otherwise\n \"Some entries in this range are correct.\"\n ),\n assert(len(cells)=0, add_credit(range_credit*w, \"{name}: \"+message)); \n range_credit\n ),\n [cells,w,name],\n zip(range_cells, range_weights, keys(settings[\"mark_ranges\"]))\n)\n\nnotation_styles:\n[\"plain\",\"si-en\"]\n\ncorrectAnswer:\nsettings[\"correct_answer\"]", "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(sum(mark_ranges)=0,\n incorrect(),\n apply(mark_ranges)\n)"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "studentAnswer"}, {"name": "range_cells", "description": "For each range to be marked, the addresses of the cells in that range.
", "definition": "map(parse_range(ref),ref,values(settings[\"mark_ranges\"]))"}, {"name": "total_cells", "description": "The total number of cells to be marked. Cells in overlapping ranges will be counted once for each range they're in.
", "definition": "len(flatten(range_cells))"}, {"name": "range_weights", "description": "The weight of each range, as a proportion of the available credit.
", "definition": "switch(\n settings[\"marking_method\"]=\"per_cell\",\n map(len(r)/total_cells, r, range_cells),\n // otherwise, mark per range\n repeat(1/len(range_cells), len(range_cells))\n)"}, {"name": "mark_ranges", "description": "Mark each of the ranges specified by the question author.
", "definition": "map(\n let(\n range_credit,\n sum(map(\n let(\n correctCellString, correctAnswer[c],\n correctCellNumber, parsenumber(correctCellString, notation_styles),\n studentCellString, studentAnswer[c],\n studentCellNumber, parsenumber(studentCellString, notation_styles),\n award(\n 1/len(cells), \n switch(\n correctCellString=\"\",\n isnan(studentCellNumber) or studentCellString=\"\",\n isnan(correctCellNumber),\n lower(correctCellString) = lower(studentCellString)\n ,\n abs(studentCellNumber - if(isnan(correctCellNumber),0,correctCellNumber)) <= settings[\"tolerance\"]\n )\n )\n ),\n c,\n cells\n )),\n message,\n switch(\n range_credit=0,\n if(len(cells)=1, \"This entry is incorrect.\", \"All entries in this range are incorrect.\"),\n range_credit=1,\n if(len(cells)=1, \"This entry is correct.\", \"All entries in this range are correct.\"),\n //otherwise\n \"Some entries in this range are correct.\"\n ),\n assert(len(cells)=0, add_credit(range_credit*w, \"{name}: \"+message)); \n range_credit\n ),\n [cells,w,name],\n zip(range_cells, range_weights, keys(settings[\"mark_ranges\"]))\n)"}, {"name": "notation_styles", "description": "Accepted number notation styles for a value in an individual cell.
", "definition": "[\"plain\",\"si-en\"]"}, {"name": "correctAnswer", "description": "", "definition": "settings[\"correct_answer\"]"}], "settings": [{"name": "initial_sheet", "label": "Initial sheet", "help_url": "", "hint": "Aspreadsheet object giving the initial state of the sheet that the student should fill in.", "input_type": "code", "default_value": "", "evaluate": true}, {"name": "correct_answer", "label": "Correct answer", "help_url": "", "hint": "A spreadsheet object representing a correct answer to the part.", "input_type": "code", "default_value": "", "evaluate": true}, {"name": "disable_ranges", "label": "Ranges to disable", "help_url": "", "hint": "A list of cell or range references, denoting the cells that should not be editable.", "input_type": "code", "default_value": "[]", "evaluate": true}, {"name": "mark_ranges", "label": "Ranges to mark", "help_url": "", "hint": "A dictionary of cell or range references, mapping names to ranges of cells, denoting the cells that should be compared for equality with the expected answer.", "input_type": "code", "default_value": "dict()", "evaluate": true}, {"name": "marking_method", "label": "Marking method", "help_url": "", "hint": "", "input_type": "dropdown", "default_value": "per_cell", "choices": [{"value": "per_cell", "label": "Each cell has the same weight"}, {"value": "per_range", "label": "Each range has the same weight"}]}, {"name": "tolerance", "label": "Allowed margin of error", "help_url": "", "hint": "", "input_type": "code", "default_value": "0", "evaluate": true}], "public_availability": "always", "published": true, "extensions": ["sheets"]}], "resources": ["question-resources/centroid-t-r.ggb"], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "William Haynes", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2530/"}], "tags": ["centroids", "first moment of area", "mechanics", "Mechanics", "statics", "Statics"], "metadata": {"description": "Find the centroid of a shape made up of a rectangle and two triangles.
", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "statement": "Determine the coordinates of the centroid of a polygon made up of a ({b0} $\\times$ {h0}) rectangle, {if(sign1='+', 'plus', 'minus')} a ({b1} $\\times$ {h1}) triangle, {if(sign2='+', 'plus', 'minus')} a ({b2} $\\times$ {h2}) triangle. Length units are [{units}].
\n{applet()}
\n{answer_sheet}
", "advice": "$\\qquad\\bar{x} = \\dfrac{Q_y}{A} = \\dfrac{\\Sigma A_i\\bar{x}_i}{\\Sigma A_i}= \\dfrac{\\var{siground(QT[0],4)}}{\\var{AT}} =\\var{display(xbar)}$
\n$\\qquad \\bar{y} = \\dfrac{Q_x}{A} = \\dfrac{\\Sigma A_i \\bar{y}_i}{\\Sigma A_i}= \\dfrac{\\var{siground(QT[1],4)}}{\\var{AT}} =\\var{display(ybar)}$
\n[ai xbari, ai ybari]
", "templateType": "anything", "can_override": false}, "Q1": {"name": "Q1", "group": "geometry", "definition": "a1 c1", "description": "", "templateType": "anything", "can_override": false}, "Q2": {"name": "Q2", "group": "geometry", "definition": "a2 c2", "description": "", "templateType": "anything", "can_override": false}, "QT": {"name": "QT", "group": "geometry", "definition": "Q0+Q1+Q2", "description": "", "templateType": "anything", "can_override": false}, "answer_sheet": {"name": "answer_sheet", "group": "Ungrouped variables", "definition": "fill_range(centroids_sheet,\"E2:F5\",map(v->[siground(v[0],4),siground(v[1],4)],[Q0,Q1,Q2,QT]))", "description": "", "templateType": "anything", "can_override": false}, "xbar2": {"name": "xbar2", "group": "Unnamed group", "definition": "Qt[0]/(At)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "B[1]<>A[1] and B[0]<>C[0]", "maxRuns": "100"}, "ungrouped_variables": ["A", "B", "C", "D", "units", "debug", "blank_sheet", "areas_sheet", "centroids_sheet", "answer_sheet"], "variable_groups": [{"name": "geometry", "variables": ["b0", "h0", "b2", "h1", "b1", "h2", "sign1", "sign2", "A0", "A1", "A2", "AT", "C0", "C2", "C1", "Q0", "Q1", "Q2", "QT"]}, {"name": "Unnamed group", "variables": ["xbar", "ybar", "xbar2"]}], "functions": {"Q": {"parameters": [["area", "?"], ["distance", "?"]], "type": "quantity", "language": "jme", "definition": "display(area*distance*qty(1,units)*qty(1,units)*qty(1,units))"}, "display": {"parameters": [["q", "quantity"]], "type": "quantity", "language": "jme", "definition": "string(siground(q,4))"}, "bar": {"parameters": [["coord", "number"]], "type": "quantity", "language": "jme", "definition": "display(quantity(coord,units))"}, "applet": {"parameters": [], "type": "ggbapplet", "language": "javascript", "definition": "\n// Create the worksheet. \n// This function returns an object with a container `element` and a `promise` resolving to a GeoGebra applet.\nvar params = {\n material_id: 'ftkm8mfx',\n //alternate method, load from file.\n //filename: \"resources/question-resources/centroid-t-r.ggb\",\n //width:400,\n //height:300\n // was geogebra_applet('ftkm8mfx',[['A',A],['B',B],['C',C]])\n}\n\nvar result = Numbas.extensions.geogebra.createGeogebraApplet(params);\n\n// Once the applet has loaded, run some commands to manipulate the worksheet.\nresult.promise.then(function(d) {\n var app = d.app;\n question.applet = d;\n \n \nfunction setGGBPoint(name) {\n // moves point in GGB to location of Numbas Vector Variable\n var pt = question.scope.evaluate(name).value\n app.setFixed(name,false,false);\n app.setCoords(name, pt[0], pt[1]);\n app.setFixed(name,true,true);\n }\n\n setGGBPoint(\"A\");\n setGGBPoint(\"B\");\n setGGBPoint(\"C\");\n setGGBPoint(\"D\");\n app.setVisible(\"Centroid\",false);\n \n});\n\n// This function returns the result of `createGeogebraApplet` as an object \n// with the JME data type 'ggbapplet', which can be substituted into the question's content.\nreturn new Numbas.jme.types.ggbapplet(result);"}}, "preamble": {"js": "question.signals.on('adviceDisplayed',function() {\n try{\n var app = question.applet.app;\n \n app.setVisible(\"Centroid\",true);\n \n }\n catch(err){} \n})\n\n\n\n", "css": "table.centroid{margin-left:0;}\n\ntable.centroid td {\n width:6em; \n vertical-align:center; \n text-align:center;}\ntable.centroid *.underline {border-bottom: 2px solid black;}\n\n"}, "parts": [{"type": "spreadsheet", "useCustomName": true, "customName": "Centroid Table", "marks": "36", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "settings": {"initial_sheet": "blank_sheet", "correct_answer": "answer_sheet", "disable_ranges": "[\"A1:F1\", \"A1:A5\", \"C5:D5\"]", "mark_ranges": "[\"$A_i$\": \"B2:B4\", \"$\\\\bar{x}$\": \"C2:C4\", \"$\\\\bar{y}$\": \"D2:D4\", \"$A_i\\\\bar{x}_i$\": \"E2:E4\", \"$A_i\\\\bar{y}_i$\": \"F2:F4\",\"$A$\":\"B5\", \"$Q_y$\": \"E5\", \"$Q_x$\":\"F5\"]", "marking_method": "per_cell", "tolerance": "0.05"}}, {"type": "gapfill", "useCustomName": true, "customName": "Results", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "$\\bar{x} =\\dfrac{Q_y}{A} = $ [[0]]
\n$\\bar{y} =\\dfrac{Q_x}{A} = $ [[1]]
", "gaps": [{"type": "engineering-answer", "useCustomName": true, "customName": "$\\bar{x}$", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "settings": {"correctAnswer": "xbar", "right": "0.2", "close": "1.0", "C1": "75", "C2": "50", "C3": "25"}}, {"type": "engineering-answer", "useCustomName": true, "customName": "$\\bar{y}$", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "settings": {"correctAnswer": "ybar", "right": "0.2", "close": "1.0", "C1": "75", "C2": "50", "C3": "25"}}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}]}, {"name": "Centroids by Integration", "pickingStrategy": "all-ordered", "pickQuestions": 1, "questionNames": ["", "Area under a curve", "", "Upper and lower bounds are functions"], "variable_overrides": [[], [], [], []], "questions": [{"name": "Differential Elements", "extensions": ["geogebra"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "William Haynes", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2530/"}], "tags": ["centroids", "centroids by integration", "Mechanics", "mechanics", "Statics", "statics"], "metadata": {"description": "Given a random spandrel, find the expressions for the differential elements of area and the coordinates of its centroid needed to determine the location of the centroid by integration.
", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "statement": "{geogebra_applet('tpndhsyt',[['version',version]])}
", "advice": "The area of the strip, dA is the width times the height of the strip.
\nThe narrow width of the element is either $dx$ or $dy$
\nThe coordinates of the centroid are found by averaging the coordinates of the top and bottom of the strip.
", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"dA": {"name": "dA", "group": "Ungrouped variables", "definition": "expression(['y*dx',\"(y'-y)*dx\",\"(b-y)*dx\", \"(x-x')*dy\",\"x*dy\",\"(a-x)*dy\"][version-1\n])", "description": "", "templateType": "anything", "can_override": false}, "ybar": {"name": "ybar", "group": "Ungrouped variables", "definition": "expression([\"y/2\",\"(y+y')/2\",\"(y+b)/2\",\"y\",\"y\",\"y\"][version-1])", "description": "", "templateType": "anything", "can_override": false}, "xbar": {"name": "xbar", "group": "Ungrouped variables", "definition": "expression([\"x\",\"x\",\"x\",\"(x+x')/2\",\"x/2\",\"(x+a)/2\"][version-1])", "description": "", "templateType": "anything", "can_override": false}, "version": {"name": "version", "group": "Ungrouped variables", "definition": "random(1..6)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["version", "dA", "xbar", "ybar"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Determine the properties of the differential strip in terms of the known coordinates.
\n$dA$ = [[0]]
\n$\\bar{x}_{el}$ = [[1]]
\n$\\bar{y}_{el}$ =[[2]]
", "gaps": [{"type": "jme", "useCustomName": true, "customName": "da", "marks": "10", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{dA}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}, {"type": "jme", "useCustomName": true, "customName": "xbar", "marks": "10", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{xbar}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}, {"type": "jme", "useCustomName": true, "customName": "ybar", "marks": "10", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{ybar}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "Area under a curve by integration", "extensions": ["geogebra", "quantities"], "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.
", "help_url": "", "input_widget": "string", "input_options": {"correctAnswer": "siground(settings['correctAnswer'],4)", "hint": {"static": true, "value": ""}, "allowEmpty": {"static": true, "value": true}}, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\nswitch( \n right and good_units and right_sign, add_credit(1.0,'Correct.'),\n right and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\n right and right_sign and not good_units, add_credit(settings['C2'],'Correct value, but wrong or missing units.'),\n close and good_units, add_credit(settings['C1'],'Close.'),\n close and not good_units, add_credit(settings['C3'],'Answer is close, but wrong or missing units.'),\n incorrect('Wrong answer.')\n)\n\ninterpreted_answer:\nqty(student_scalar, student_units)\n\n\n\ncorrect_quantity:\nsettings[\"correctAnswer\"]\n\n\n\ncorrect_units:\nunits(correct_quantity)\n\n\nallowed_notation_styles:\n[\"plain\",\"en\"]\n\nmatch_student_number:\nmatchnumber(studentAnswer,allowed_notation_styles)\n\nstudent_scalar:\nmatch_student_number[1]\n\nstudent_units:\nreplace_regex('ohms','ohm',\n replace_regex('\u00b0', ' deg',\n replace_regex('-', ' ' ,\n studentAnswer[len(match_student_number[0])..len(studentAnswer)])),\"i\")\n\ngood_units:\ntry(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n\n\nstudent_quantity:\nswitch(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\n\npercent_error:\ntry(\nscalar(abs((correct_quantity - student_quantity)/correct_quantity))*100 \n,msg,\nif(student_quantity=correct_quantity,0,100))\n \n\nright:\npercent_error <= settings['right']\n\n\nclose:\nright_sign and percent_error <= settings['close']\n\nright_sign:\nsign(student_scalar) = sign(correct_quantity)", "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": "switch( \n right and good_units and right_sign, add_credit(1.0,'Correct.'),\n right and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\n right and right_sign and not good_units, add_credit(settings['C2'],'Correct value, but wrong or missing units.'),\n close and good_units, add_credit(settings['C1'],'Close.'),\n close and not good_units, add_credit(settings['C3'],'Answer is close, but wrong or missing units.'),\n incorrect('Wrong answer.')\n)"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "qty(student_scalar, student_units)\n\n"}, {"name": "correct_quantity", "description": "", "definition": "settings[\"correctAnswer\"]\n\n"}, {"name": "correct_units", "description": "", "definition": "units(correct_quantity)\n"}, {"name": "allowed_notation_styles", "description": "", "definition": "[\"plain\",\"en\"]"}, {"name": "match_student_number", "description": "", "definition": "matchnumber(studentAnswer,allowed_notation_styles)"}, {"name": "student_scalar", "description": "", "definition": "match_student_number[1]"}, {"name": "student_units", "description": "Modify the unit portion of the student's answer by
\n1. replacing \"ohms\" with \"ohm\" case insensitive
\n2. replacing '-' with ' '
\n3. replacing '°' with ' deg'
\nto allow answers like 10 ft-lb and 30°
", "definition": "replace_regex('ohms','ohm',\n replace_regex('\u00b0', ' deg',\n replace_regex('-', ' ' ,\n studentAnswer[len(match_student_number[0])..len(studentAnswer)])),\"i\")"}, {"name": "good_units", "description": "", "definition": "try(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n"}, {"name": "student_quantity", "description": "This fixes the student answer for two common errors.
\nIf student_units are wrong - replace with correct units
\nIf student_scalar has the wrong sign - replace with right sign
\nIf student makes both errors, only one gets fixed.
", "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"}, {"name": "percent_error", "description": "", "definition": "try(\nscalar(abs((correct_quantity - student_quantity)/correct_quantity))*100 \n,msg,\nif(student_quantity=correct_quantity,0,100))\n "}, {"name": "right", "description": "", "definition": "percent_error <= settings['right']\n"}, {"name": "close", "description": "Only marked close if the student actually has the right sign.
", "definition": "right_sign and percent_error <= settings['close']"}, {"name": "right_sign", "description": "", "definition": "sign(student_scalar) = sign(correct_quantity) "}], "settings": [{"name": "correctAnswer", "label": "Correct Quantity.", "help_url": "", "hint": "The correct answer given as a JME quantity.", "input_type": "code", "default_value": "", "evaluate": true}, {"name": "right", "label": "% Accuracy for right.", "help_url": "", "hint": "Question will be considered correct if the scalar part of the student's answer is within this % of correct value.", "input_type": "code", "default_value": "0.2", "evaluate": true}, {"name": "close", "label": "% Accuracy for close.", "help_url": "", "hint": "Question will be considered close if the scalar part of the student's answer is within this % of correct value.", "input_type": "code", "default_value": "1.0", "evaluate": true}, {"name": "C1", "label": "Close with units.", "help_url": "", "hint": "Partial Credit for close value with appropriate units. if correct answer is 100 N and close is ±1%,Find roots and the area under a parabola
", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "statement": "{applet()}
\nGiven 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\n\n", "advice": "$\\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/2 + {C}x}\\right]_0^\\var{scalar(siground(root1,4))}\\\\&=\\var{siground(area,4)}\\end{align}$
", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"area": {"name": "area", "group": "Ungrouped variables", "definition": "let(x,scalar(root1), qty(A x^3/3 + B x^2/2 + C x,units)) qty(units)", "description": "", "templateType": "anything", "can_override": false}, "A": {"name": "A", "group": "Ungrouped variables", "definition": "random(-0.5..-2#0.5)", "description": "", "templateType": "anything", "can_override": false}, "debug": {"name": "debug", "group": "Ungrouped variables", "definition": "false", "description": "", "templateType": "anything", "can_override": false}, "C": {"name": "C", "group": "Ungrouped variables", "definition": "random(0..3)+0.5", "description": "", "templateType": "anything", "can_override": false}, "B": {"name": "B", "group": "Ungrouped variables", "definition": "random(1..4)", "description": "", "templateType": "anything", "can_override": false}, "units": {"name": "units", "group": "Ungrouped variables", "definition": "random('in','ft','mm','cm')", "description": "", "templateType": "anything", "can_override": false}, "root1": {"name": "root1", "group": "Ungrouped variables", "definition": "qty((-b - sqrt(b^2-4 a c))/(2 a),units)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["A", "B", "C", "root1", "area", "units", "debug"], "variable_groups": [], "functions": {"applet": {"parameters": [], "type": "ggbapplet", "language": "javascript", "definition": "\n// Create the worksheet. \n// This function returns an object with a container `element` and a `promise` resolving to a GeoGebra applet.\nvar params = {\n filename: 'resources/question-resources/centroid-integration.ggb',\n width: 300,\n height: 300\n // was {geogebra_applet('nuhzkzqp',[['a',A],['b',B],['c',C]])}\n}\n\nvar result = Numbas.extensions.geogebra.createGeogebraApplet(params);\n\n// Once the applet has loaded, run some commands to manipulate the worksheet.\nresult.promise.then(function(d) {\n var app = d.app;\n question.applet = d;\n \n function setGGBNumber(name) {\n // Sets number in GGB to a Numbas Variable\n var n = question.scope.evaluate(name).value;\n app.setValue(name,n);\n }\n \nfunction setGGBPoint(name) {\n // moves point in GGB to location of Numbas Vector Variable\n var pt = question.scope.evaluate(name).value\n app.setFixed(name,false,false);\n app.setCoords(name, pt[0], pt[1]);\n app.setFixed(name,true,true);\n }\n\n setGGBPoint(\"a\");\n setGGBPoint(\"b\");\n setGGBPoint(\"c\");\n app.setGridVisible(false);\n app.recalculateEnvironments();\n\n \n});\n\n// This function returns the result of `createGeogebraApplet` as an object \n// with the JME data type 'ggbapplet', which can be substituted into the question's content.\nreturn new Numbas.jme.types.ggbapplet(result);"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Determine the points where the curve crosses the axes.
\n$h$ = [[0]] {qty(C,units)}
\n$a$ = [[1]] {siground(root1,4)}
", "gaps": [{"type": "engineering-answer", "useCustomName": true, "customName": "h", "marks": "5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "settings": {"correctAnswer": "qty(C,units)", "right": "0.2", "close": "1.0", "C1": "75", "C2": "50", "C3": "25"}}, {"type": "engineering-answer", "useCustomName": true, "customName": "a", "marks": "5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "settings": {"correctAnswer": "root1", "right": "0.2", "close": "1.0", "C1": "75", "C2": "50", "C3": "25"}}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": true, "customName": "A", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "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)}
", "gaps": [{"type": "engineering-answer", "useCustomName": true, "customName": "area", "marks": "10", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "settings": {"correctAnswer": "area", "right": "0.2", "close": "1.0", "C1": "75", "C2": "50", "C3": "25"}}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "Centroids by integration ", "extensions": ["geogebra"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "William Haynes", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2530/"}], "tags": ["area under curve", "centroidal coordinates", "centroids by integration", "first moment of area", "integration", "Mechanics", "mechanics", "Statics", "statics"], "metadata": {"description": "Find the area, first moment of area, and coordinates of a general spandrel. The area may be above or below the function.
", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "statement": "{applet}
\nUse integration with {if(Vertical=1,'vertical','horizontal')} strips to determine the area of the spandrel bounded by the function $\\color{red}{y = f(x) = h - k \\simplify[all,fractionnumbers]{x^{n}}}$ and $\\var{if(Above=1, 'the lines $y=h$ and $x=b$','the $x$- and $y$-axes')}$, and also find the coordinates of its centroid. Note: b and h are constants.
", "advice": "Note: The solutions below is for Vertical Strips.
\nThe procedure for horizontal strips is similar, but with these strip properties and limits:
\nStrip properties: $dA = (b-x)\\,dy$, $\\bar{x}_{el} = \\dfrac{x+b}{y}$, $\\bar{y}_{el} = y $ $dA = x \\,dy$, $\\bar{x}_{el} = x/2$, $\\bar{y}_{el} =y$
\nLimits: $x= 0 \\text{ to } h$
\nYou will get the same results for $A, Q_x, Q_y, \\bar{x} \\text{ and } \\bar{y}$, which ever strips you choose.
\n1. Bounding function: $y = f(x) = h - k \\simplify[all,fractionnumbers]{x^{n}}$
\n2. Constant $k$ in terms of $b$: at $x=b, y=0 \\therefore h - k \\simplify[all,fractionnumbers]{b^{n}} = 0 \\therefore k = \\dfrac{h}{\\simplify[all,fractionnumbers]{b^{n}}}$
\n3. Strip properties: $dA = y\\,dx$, $\\bar{x}_{el} = x$, $\\bar{y}_{el} = y/2$ $dA = (h-y)\\,dx$, $\\bar{x}_{el} = x$, $\\bar{y}_{el} = (h+y)/2$
\n4. Limits: $x= 0 \\text{ to } b$
\n5. Area under the curve:
\n$\\begin{align} A &= \\int dA\\\\&= \\int_0^b y\\, dx\\\\&= \\int_0^b (h - k \\simplify[all,fractionnumbers]{x^{n}})\\, dx\\\\&= \\left[ hx - k \\dfrac{\\simplify[all,fractionnumbers]{x^{n+1}}}{\\simplify[all,fractionnumbers]{{n+1}}}\\right]_0^b\\\\&= \\left[ hb - \\left(\\dfrac{h}{\\simplify[all,fractionnumbers]{b^{n}}}\\right) \\dfrac{\\simplify[all,fractionnumbers]{b^{n+1}}}{\\simplify[all,fractionnumbers]{{n+1}}}\\right]\\\\&=hb-\\dfrac{hb}{\\simplify[all,fractionnumbers]{{n}+1}}\\\\&=\\var[all,fractionnumbers]{{n}/({n}+1)} h b\\end{align}$
\n$\\begin{align} A &= \\int dA\\\\&= \\int_0^b (h-y)\\, dx\\\\&= \\int_0^b h - (h - k \\simplify[all,fractionnumbers]{x^{n}})\\, dx\\\\&=\\int_0^bk \\simplify[all,fractionnumbers]{x^{n}}dx\\\\&= \\left[k \\dfrac{\\simplify[all,fractionnumbers]{x^{n+1}}}{\\simplify[all,fractionnumbers]{{n+1}}}\\right]_0^b\\\\&= \\left[ \\left(\\dfrac{h}{\\simplify[all,fractionnumbers]{b^{n}}}\\right) \\dfrac{\\simplify[all,fractionnumbers]{b^{n+1}}}{\\simplify[all,fractionnumbers]{{n+1}}}\\right]\\\\&=\\dfrac{hb}{\\simplify[all,fractionnumbers]{{n}+1}}\\\\&=\\var[all,fractionnumbers]{1/({n}+1)} h b\\end{align}$
\n6. $Q_x$ and $Q_y$ Perform similar integrations to get:
\n$Q_x = \\int \\bar{y}_{el}\\,dA = \\simplify[all,simplifyfractions,fractionnumbers]{{n}^2 /(2{n}^2+3{n}+1) h^2b} \\qquad Q_y = \\int \\bar{x}_{el}\\,dA = \\simplify[all,fractionnumbers,simplifyfractions]{{n}/(2{n}+4)} hb^2$
\n$Q_x = \\int \\bar{y}_{el}\\,dA = \\simplify[all,simplifyfractions,fractionnumbers]{(3{n}+1)/(2({n}+1)(2{n}+1))}h^2b \\qquad Q_y = \\int \\bar{x}_{el}\\,dA = \\simplify[all,fractionnumbers,simplifyfractions]{1/({n}+2)} hb^2$
\n7. Centroid:
\n$\\bar{x} = \\dfrac{Q_y}{A} = \\dfrac{\\simplify[all,fractionnumbers,simplifyfractions]{{n}/(2{n}+4)} hb^2}{\\var[all,fractionnumbers]{{n}/({n}+1)} h b} = \\simplify[all,collectnumbers]{({n}+1)/(2{n}+4)}b \\qquad \\bar{y} = \\dfrac{Q_x}{A} = \\dfrac{\\simplify[all,fractionnumbers,simplifyfractions]{{n^2}/(({n}+1)(2{n}+1))} h^2b}{\\var[all,fractionnumbers]{{n}/({n}+1)} h b} = \\simplify[all,collectnumbers,simplifyfractions]{{n}/(2{n}+1)}h $
\n$\\bar{x} = \\dfrac{Q_y}{A} = \\dfrac{\\simplify[all,fractionnumbers,simplifyfractions]{1/({n}+2)} hb^2}{\\var[all,fractionnumbers]{1/({n}+1)} h b} = \\simplify[all,collectnumbers]{({n}+1)/({n}+2)}b \\qquad \\bar{y} = \\dfrac{Q_x}{A} = \\dfrac{\\simplify[all,simplifyfractions,fractionnumbers]{(3{n}+1)/(2({n}+1)(2{n}+1))}h^2b}{\\var[all,fractionnumbers]{1/({n}+1)} h b} = \\simplify[all,collectnumbers,simplifyfractions]{(3{n}+1)/(4{n}+2)}h $
", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"Qy": {"name": "Qy", "group": "answers", "definition": " simplify(substitute([\"n\" :n],\n if(Above=1, \n expression('h b^2 / (n+2)'),\n expression('h b^2 n / (2 n + 4 )'))),\"basic,collectNumbers,simplifyFractions,constantsFirst\")", "description": "", "templateType": "anything", "can_override": false}, "ybar_el": {"name": "ybar_el", "group": "answers", "definition": "expression(['y','y/2','y','(h+y)/2'][version])", "description": "", "templateType": "anything", "can_override": false}, "xbar": {"name": "xbar", "group": "answers", "definition": " simplify(substitute([\"n\" :n],\n if(Above=1,\n expression('b* (n+1)/(n+2)'),\n expression('b * (n+1)/(2n+4)'))),\"basic,collectNumbers,simplifyFractions,cancelTerms\")", "description": "expression(\"(\"+ string(Qy) +\")/(\"+ string(area) +\")\")
", "templateType": "anything", "can_override": false}, "debug": {"name": "debug", "group": "inputs", "definition": "false", "description": "", "templateType": "anything", "can_override": false}, "k": {"name": "k", "group": "inputs", "definition": "expression(if(vertical=1,'h/b^n','b/h^(1/n)'))", "description": "", "templateType": "anything", "can_override": false}, "Qx": {"name": "Qx", "group": "answers", "definition": " simplify(substitute([\"n\" :n],\n if(Above=1,\n expression('(b h^2 /2)(3n+1)/((n+1) (2n+1))'),\n expression('h^2 b n^2/((n+1)(2n+1))'))),\"basic,collectNumbers,simplifyFractions,constantsFirst\")", "description": "", "templateType": "anything", "can_override": false}, "Above": {"name": "Above", "group": "inputs", "definition": "random(0,1)", "description": "area above or below the curve?
", "templateType": "anything", "can_override": false}, "version": {"name": "version", "group": "inputs", "definition": "2 above + vertical\n", "description": "0 = below horizontal
\n1 = below vertical
\n2 = above horizontal
\n3 = above vertical
\nhorizontal strips not implemented
", "templateType": "anything", "can_override": false}, "Vertical": {"name": "Vertical", "group": "inputs", "definition": "random(0,1)", "description": "0 = horizontal strips
\n1 = vertical strips? Horizontal strips not currently implemented.
\n\nCan't figure out how to pass a boolean to geogebra, so using {0,1} instead. Only exponents < 2 can be horizontal
", "templateType": "anything", "can_override": false}, "ybar": {"name": "ybar", "group": "answers", "definition": " simplify(substitute([\"n\" :n],if(Above=1,\n expression('h * (3 n +1)/(4 n+2)'),\n expression('h n / (2 n+1)'))),\"basic,collectNumbers,simplifyFractions\")", "description": "", "templateType": "anything", "can_override": false}, "area": {"name": "area", "group": "answers", "definition": "simplify(substitute([\"n\" :n], if(Above=1,\n expression('b h / (n+1)'),\n expression('b h n /(n +1)'))),\"basic,collectNumbers,simplifyFractions,cancelTerms\")", "description": "
ok
", "templateType": "anything", "can_override": false}, "lower_limit": {"name": "lower_limit", "group": "answers", "definition": "0", "description": "", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "inputs", "definition": "random(1/3,1/2,1,3/2,2,3)", "description": "the exponent of the function (1-kx^n) (0.5 .. 5#0.5)
", "templateType": "anything", "can_override": false}, "upper_limit": {"name": "upper_limit", "group": "answers", "definition": "if(Vertical=1,'b','h')", "description": "", "templateType": "anything", "can_override": false}, "xbar_el": {"name": "xbar_el", "group": "answers", "definition": "expression(['x/2','x','(b+x)/2','x'][version])", "description": "", "templateType": "anything", "can_override": false}, "dA": {"name": "dA", "group": "answers", "definition": "expression(['x dy','y dx','(b-x) dy','(h-y) dx'][version])", "description": "", "templateType": "anything", "can_override": false}, "applet": {"name": "applet", "group": "Ungrouped variables", "definition": "geogebra_applet('bqnqgpfp',[['n',n],['h',random(1,1.5)],['b',random(0.8,1.3)],['Above', above],['Vertical',vertical]])", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["applet"], "variable_groups": [{"name": "inputs", "variables": ["n", "version", "Vertical", "Above", "k", "debug"]}, {"name": "answers", "variables": ["dA", "xbar_el", "ybar_el", "upper_limit", "lower_limit", "area", "Qy", "xbar", "ybar", "Qx"]}], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": true, "customName": "Bounding function", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "The bounding funtion contains a constant $k$ which can be expressed in terms of $b$ and $h$. Determine the value of $k$ in terms of b and h by substituting in the coordinates of a point which is on the curve into the bounding function.
\n$k$ = [[0]] {k}
\n", "gaps": [{"type": "jme", "useCustomName": true, "customName": "k", "marks": "5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "h/b^{n}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "b", "value": ""}, {"name": "h", "value": ""}]}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": true, "customName": "Strip", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Determine the area of the rectangular differential strip.
\n$dA$ = [[0]] {da}
\nDetermine expressions for the coordinates of the centroid of the strip.
\n$\\bar{x}_{el} = $ [[1]] $\\qquad\\bar{y}_{el} = $ [[2]] xbar= {xbar_el} ybar = {ybar_el}
", "gaps": [{"type": "jme", "useCustomName": true, "customName": "$dA$", "marks": "5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{dA}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}, {"type": "jme", "useCustomName": true, "customName": "$\\bar{x}$", "marks": "5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{xbar_el}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}, {"type": "jme", "useCustomName": true, "customName": "$\\bar{y}$", "marks": "5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{ybar_el}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": true, "customName": "Limits", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Lower limit is: [[0]] {0} $\\qquad$ Upper limit is: [[1]] {upper_limit}
", "gaps": [{"type": "patternmatch", "useCustomName": true, "customName": "lower", "marks": "5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "0", "displayAnswer": "", "matchMode": "exact", "allowEmpty": false}, {"type": "patternmatch", "useCustomName": true, "customName": "upper", "marks": "5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{upper_limit}", "displayAnswer": "", "matchMode": "exact", "allowEmpty": false}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": true, "customName": "Area", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "With the information determined above, evaluate this integral to find the area of the spandrel in terms of constants b and h.
\n$A = \\int dA = $ [[0]]
\narea = {area}
", "gaps": [{"type": "jme", "useCustomName": true, "customName": "area", "marks": "10", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{area}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": true, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": true, "customName": "First Moments", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Perform the following integrals to determine the first moments of area with respect to the x- and y-axis.
\n\n$Q_x = \\int \\bar{y}_{el} dA =$ [[0]] {Qx} $\\qquad Q_y = \\int \\bar{x}_{el} dA =$ [[1]] {Qy}
\n", "gaps": [{"type": "jme", "useCustomName": true, "customName": "qx", "marks": "5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{Qx}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": true, "allowUnknownFunctions": false, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}, {"type": "jme", "useCustomName": true, "customName": "qy", "marks": "5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{Qy}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": true, "allowUnknownFunctions": false, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": true, "customName": "Centroid", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Use the information you found above to determine the coordinates of the centroid of the shaded spandrel.
\n$\\bar{x} = \\dfrac{Q_y}{A} = $ [[0]] {xbar} $\\qquad\\bar{y} = \\dfrac{Q_x}{A} = $ [[1]] {ybar}
", "gaps": [{"type": "jme", "useCustomName": true, "customName": "xbar", "marks": "5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{xbar}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": true, "allowUnknownFunctions": false, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}, {"type": "jme", "useCustomName": true, "customName": "ybar", "marks": "5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{ybar}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": true, "allowUnknownFunctions": false, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "Centroid by integration: upper and lower bounds are functions", "extensions": ["geogebra", "quantities"], "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.
", "help_url": "", "input_widget": "string", "input_options": {"correctAnswer": "siground(settings['correctAnswer'],4)", "hint": {"static": true, "value": ""}, "allowEmpty": {"static": true, "value": true}}, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\nswitch( \n right and good_units and right_sign, add_credit(1.0,'Correct.'),\n right and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\n right and right_sign and not good_units, add_credit(settings['C2'],'Correct value, but wrong or missing units.'),\n close and good_units, add_credit(settings['C1'],'Close.'),\n close and not good_units, add_credit(settings['C3'],'Answer is close, but wrong or missing units.'),\n incorrect('Wrong answer.')\n)\n\ninterpreted_answer:\nqty(student_scalar, student_units)\n\n\n\ncorrect_quantity:\nsettings[\"correctAnswer\"]\n\n\n\ncorrect_units:\nunits(correct_quantity)\n\n\nallowed_notation_styles:\n[\"plain\",\"en\"]\n\nmatch_student_number:\nmatchnumber(studentAnswer,allowed_notation_styles)\n\nstudent_scalar:\nmatch_student_number[1]\n\nstudent_units:\nreplace_regex('ohms','ohm',\n replace_regex('\u00b0', ' deg',\n replace_regex('-', ' ' ,\n studentAnswer[len(match_student_number[0])..len(studentAnswer)])),\"i\")\n\ngood_units:\ntry(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n\n\nstudent_quantity:\nswitch(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\n\npercent_error:\ntry(\nscalar(abs((correct_quantity - student_quantity)/correct_quantity))*100 \n,msg,\nif(student_quantity=correct_quantity,0,100))\n \n\nright:\npercent_error <= settings['right']\n\n\nclose:\nright_sign and percent_error <= settings['close']\n\nright_sign:\nsign(student_scalar) = sign(correct_quantity)", "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": "switch( \n right and good_units and right_sign, add_credit(1.0,'Correct.'),\n right and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\n right and right_sign and not good_units, add_credit(settings['C2'],'Correct value, but wrong or missing units.'),\n close and good_units, add_credit(settings['C1'],'Close.'),\n close and not good_units, add_credit(settings['C3'],'Answer is close, but wrong or missing units.'),\n incorrect('Wrong answer.')\n)"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "qty(student_scalar, student_units)\n\n"}, {"name": "correct_quantity", "description": "", "definition": "settings[\"correctAnswer\"]\n\n"}, {"name": "correct_units", "description": "", "definition": "units(correct_quantity)\n"}, {"name": "allowed_notation_styles", "description": "", "definition": "[\"plain\",\"en\"]"}, {"name": "match_student_number", "description": "", "definition": "matchnumber(studentAnswer,allowed_notation_styles)"}, {"name": "student_scalar", "description": "", "definition": "match_student_number[1]"}, {"name": "student_units", "description": "Modify the unit portion of the student's answer by
\n1. replacing \"ohms\" with \"ohm\" case insensitive
\n2. replacing '-' with ' '
\n3. replacing '°' with ' deg'
\nto allow answers like 10 ft-lb and 30°
", "definition": "replace_regex('ohms','ohm',\n replace_regex('\u00b0', ' deg',\n replace_regex('-', ' ' ,\n studentAnswer[len(match_student_number[0])..len(studentAnswer)])),\"i\")"}, {"name": "good_units", "description": "", "definition": "try(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n"}, {"name": "student_quantity", "description": "This fixes the student answer for two common errors.
\nIf student_units are wrong - replace with correct units
\nIf student_scalar has the wrong sign - replace with right sign
\nIf student makes both errors, only one gets fixed.
", "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"}, {"name": "percent_error", "description": "", "definition": "try(\nscalar(abs((correct_quantity - student_quantity)/correct_quantity))*100 \n,msg,\nif(student_quantity=correct_quantity,0,100))\n "}, {"name": "right", "description": "", "definition": "percent_error <= settings['right']\n"}, {"name": "close", "description": "Only marked close if the student actually has the right sign.
", "definition": "right_sign and percent_error <= settings['close']"}, {"name": "right_sign", "description": "", "definition": "sign(student_scalar) = sign(correct_quantity) "}], "settings": [{"name": "correctAnswer", "label": "Correct Quantity.", "help_url": "", "hint": "The correct answer given as a JME quantity.", "input_type": "code", "default_value": "", "evaluate": true}, {"name": "right", "label": "% Accuracy for right.", "help_url": "", "hint": "Question will be considered correct if the scalar part of the student's answer is within this % of correct value.", "input_type": "code", "default_value": "0.2", "evaluate": true}, {"name": "close", "label": "% Accuracy for close.", "help_url": "", "hint": "Question will be considered close if the scalar part of the student's answer is within this % of correct value.", "input_type": "code", "default_value": "1.0", "evaluate": true}, {"name": "C1", "label": "Close with units.", "help_url": "", "hint": "Partial Credit for close value with appropriate units. if correct answer is 100 N and close is ±1%,Use integration to find the centroid of an area bounded by a parabola, a sloping line, and the y-axis.
", "licence": "Creative Commons Attribution-ShareAlike 4.0 International"}, "statement": "{applet()}
\nDetermine the coordinates of the centroid of the shaded area bounded by the $y$-axis, a parabola passing throught the origin and point $A$, and a straight line passing through points $A$ and $B$.
\nGiven: $A = ( \\var{A[0]}, \\var{A[1]} ), B = (0, \\var{b}) $
", "advice": "Bounding Functions
\nParabola: $f(x) = k x^2$
\nat $x=\\var{A[0]}, f(x)=\\var{A[1]}$ , so $k = \\dfrac{\\var{A[1]}}{\\var{A[0]}^2}$
\nso, $f(x) = \\var[fractionNumbers]{A[1]/A[0]^2} x^2$
\nLine: $g(x) = m x + b$
\nwhere $m = \\dfrac{(\\var{A[1]}-\\var{b})}{\\var{x}}$, and $b = \\var{b}$
\nso, g(x) = $\\var[fractionNumbers]{(A[1]-b) /x} x + \\var{b}$
\nStrip Properties for Vertical strips
\n$dA = [g(x) - f(x)]\\; dx =\\left(\\simplify[all]{- {A[1]}/{A[0]}^2} x^2 +\\simplify{({A[1]}-{b}) /{x}} x + \\simplify{{b}} \\right )\\; dx $
\n$\\bar{x}_{el} = x$
\n$\\bar{y}_{el} = \\dfrac{g(x) + f(x)}{2} $
\nIntegrals
\n$A = \\int_0^\\var{x}\\; dA = \\var{siground(area,4)} \\text{ units}^2$
\n$Q_y = \\int_0^\\var{x} \\bar{x}_{el} \\; dA = \\var{siground(Qy,4)} \\text{ units}^3$
\n$Q_x = \\int_0^\\var{x} \\bar{y}_{el} \\; dA = \\var{siground(Qx,4)}\\text{ units}^3$
\nCentroid
\n$\\bar{x} = \\dfrac{Q_y}{A} = \\var{siground(xbar,4)}$ units
\n$\\bar{y} = \\dfrac{Q_x}{A} = \\var{siground(ybar,4)}$ units
", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"A": {"name": "A", "group": "Ungrouped variables", "definition": "vector(random(1..10),random(3..12))", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(0..10)", "description": "y component of point B
", "templateType": "anything", "can_override": false}, "k": {"name": "k", "group": "Ungrouped variables", "definition": "A[1]/A[0]^2", "description": "", "templateType": "anything", "can_override": false}, "m": {"name": "m", "group": "Ungrouped variables", "definition": "(A[1]-b)/A[0]", "description": "slope
", "templateType": "anything", "can_override": false}, "area": {"name": "area", "group": "Unnamed group", "definition": "- k x^3/3 + m x^2/2 + b x", "description": "", "templateType": "anything", "can_override": false}, "x": {"name": "x", "group": "Ungrouped variables", "definition": "A[0]", "description": "", "templateType": "anything", "can_override": false}, "Qy": {"name": "Qy", "group": "Unnamed group", "definition": "- k x^4/4 + m x^3/3 + b x^2/2", "description": "", "templateType": "anything", "can_override": false}, "xbar": {"name": "xbar", "group": "Unnamed group", "definition": "Qy/area", "description": "", "templateType": "anything", "can_override": false}, "Qx": {"name": "Qx", "group": "Unnamed group", "definition": "(-k^2 x^5/5 + m^2 x^3/3 + m b x^2 + b^2 x)/2", "description": "", "templateType": "anything", "can_override": false}, "ybar": {"name": "ybar", "group": "Unnamed group", "definition": "Qx/area", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "m <> 0 // don't want the line to be horizontal", "maxRuns": 100}, "ungrouped_variables": ["A", "b", "k", "m", "x"], "variable_groups": [{"name": "Unnamed group", "variables": ["area", "Qy", "xbar", "Qx", "ybar"]}], "functions": {"g": {"parameters": [["x", "number"]], "type": "number", "language": "jme", "definition": " m x + by"}, "applet": {"parameters": [], "type": "ggbapplet", "language": "javascript", "definition": "//{geogebra_applet('cpf7gyej',['A': A, 'by': b, \"C\": [visible: false, label_style: 3]])}\n// Create the worksheet. \n// This function returns an object with a container `element` and a `promise` resolving to a GeoGebra applet.\nvar params = {\n material_id: 'cpf7gyej'\n}\n\nvar result = Numbas.extensions.geogebra.createGeogebraApplet(params);\n\n// Once the applet has loaded, run some commands to manipulate the worksheet.\nresult.promise.then(function(d) {\n var app = d.app;\n question.applet = d;\n \n //initialize the dimensions and forces\n \n function setGGBPoint(g_name, n_name = g_name) {\n // moves point in GGB to location of Numbas Vector Variable\n // g_name = geogebra point, n_name = numbas vector\n \n //var pt = question.scope.evaluate(n_name).value\n var pt = scope.getVariable(n_name).value\n app.setFixed(g_name,false,false);\n app.setCoords(g_name, pt[0], pt[1]);\n app.setFixed(g_name,true,true);\n }\n \n function setGGBNumber(gname, nname=gname) {\n // Sets number in GGB to a Numbas Variable\n var n = question.scope.evaluate(nname).value;\n app.setValue(gname,n);\n }\n \n setGGBPoint(\"A\");\n setGGBNumber(\"by\", \"b\");\n app.setVisible(\"C\",false);// centroid\n\n \n});\n\n// This function returns the result of `createGeogebraApplet` as an object \n// with the JME data type 'ggbapplet', which can be substituted into the question's content.\nreturn new Numbas.jme.types.ggbapplet(result);\n"}}, "preamble": {"js": "question.signals.on('adviceDisplayed',function() {\n try{\n var app = question.applet.app;\n app.setVisible(\"C\", true,false);\n }\n catch(err){} \n \n})\n\n\n\n", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": true, "customName": "centroid", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "$\\bar{x} = $ [[0]] units
\n$\\bar{y} = $ [[1]] units
", "gaps": [{"type": "engineering-answer", "useCustomName": true, "customName": "xbar", "marks": "10", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "settings": {"correctAnswer": "qty(xbar,'')", "right": "0.2", "close": "1.0", "C1": "75", "C2": "50", "C3": "25"}}, {"type": "engineering-answer", "useCustomName": true, "customName": "ybar", "marks": "10", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "settings": {"correctAnswer": "qty(ybar,'')", "right": "0.2", "close": "1.0", "C1": "75", "C2": "50", "C3": "25"}}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}]}, {"name": "Distributed Loads", "pickingStrategy": "all-ordered", "pickQuestions": 1, "questionNames": ["Uniformly distributed load", "Uniformly varying load", "Trapezoidal loading"], "variable_overrides": [[], [], []], "questions": [{"name": "Reactions for beam with uniformly distributed load", "extensions": ["jsxgraph", "quantities", "shear-and-bending-moment-diagrams"], "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.
", "help_url": "", "input_widget": "string", "input_options": {"correctAnswer": "siground(settings['correctAnswer'],4)", "hint": {"static": true, "value": ""}, "allowEmpty": {"static": true, "value": true}}, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\nswitch( \n right and good_units and right_sign, add_credit(1.0,'Correct.'),\n right and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\n right and right_sign and not good_units, add_credit(settings['C2'],'Correct value, but wrong or missing units.'),\n close and good_units, add_credit(settings['C1'],'Close.'),\n close and not good_units, add_credit(settings['C3'],'Answer is close, but wrong or missing units.'),\n incorrect('Wrong answer.')\n)\n\ninterpreted_answer:\nqty(student_scalar, student_units)\n\n\n\ncorrect_quantity:\nsettings[\"correctAnswer\"]\n\n\n\ncorrect_units:\nunits(correct_quantity)\n\n\nallowed_notation_styles:\n[\"plain\",\"en\"]\n\nmatch_student_number:\nmatchnumber(studentAnswer,allowed_notation_styles)\n\nstudent_scalar:\nmatch_student_number[1]\n\nstudent_units:\nreplace_regex('ohms','ohm',\n replace_regex('\u00b0', ' deg',\n replace_regex('-', ' ' ,\n studentAnswer[len(match_student_number[0])..len(studentAnswer)])),\"i\")\n\ngood_units:\ntry(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n\n\nstudent_quantity:\nswitch(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\n\npercent_error:\ntry(\nscalar(abs((correct_quantity - student_quantity)/correct_quantity))*100 \n,msg,\nif(student_quantity=correct_quantity,0,100))\n \n\nright:\npercent_error <= settings['right']\n\n\nclose:\nright_sign and percent_error <= settings['close']\n\nright_sign:\nsign(student_scalar) = sign(correct_quantity)", "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": "switch( \n right and good_units and right_sign, add_credit(1.0,'Correct.'),\n right and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\n right and right_sign and not good_units, add_credit(settings['C2'],'Correct value, but wrong or missing units.'),\n close and good_units, add_credit(settings['C1'],'Close.'),\n close and not good_units, add_credit(settings['C3'],'Answer is close, but wrong or missing units.'),\n incorrect('Wrong answer.')\n)"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "qty(student_scalar, student_units)\n\n"}, {"name": "correct_quantity", "description": "", "definition": "settings[\"correctAnswer\"]\n\n"}, {"name": "correct_units", "description": "", "definition": "units(correct_quantity)\n"}, {"name": "allowed_notation_styles", "description": "", "definition": "[\"plain\",\"en\"]"}, {"name": "match_student_number", "description": "", "definition": "matchnumber(studentAnswer,allowed_notation_styles)"}, {"name": "student_scalar", "description": "", "definition": "match_student_number[1]"}, {"name": "student_units", "description": "Modify the unit portion of the student's answer by
\n1. replacing \"ohms\" with \"ohm\" case insensitive
\n2. replacing '-' with ' '
\n3. replacing '°' with ' deg'
\nto allow answers like 10 ft-lb and 30°
", "definition": "replace_regex('ohms','ohm',\n replace_regex('\u00b0', ' deg',\n replace_regex('-', ' ' ,\n studentAnswer[len(match_student_number[0])..len(studentAnswer)])),\"i\")"}, {"name": "good_units", "description": "", "definition": "try(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n"}, {"name": "student_quantity", "description": "This fixes the student answer for two common errors.
\nIf student_units are wrong - replace with correct units
\nIf student_scalar has the wrong sign - replace with right sign
\nIf student makes both errors, only one gets fixed.
", "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"}, {"name": "percent_error", "description": "", "definition": "try(\nscalar(abs((correct_quantity - student_quantity)/correct_quantity))*100 \n,msg,\nif(student_quantity=correct_quantity,0,100))\n "}, {"name": "right", "description": "", "definition": "percent_error <= settings['right']\n"}, {"name": "close", "description": "Only marked close if the student actually has the right sign.
", "definition": "right_sign and percent_error <= settings['close']"}, {"name": "right_sign", "description": "", "definition": "sign(student_scalar) = sign(correct_quantity) "}], "settings": [{"name": "correctAnswer", "label": "Correct Quantity.", "help_url": "", "hint": "The correct answer given as a JME quantity.", "input_type": "code", "default_value": "", "evaluate": true}, {"name": "right", "label": "% Accuracy for right.", "help_url": "", "hint": "Question will be considered correct if the scalar part of the student's answer is within this % of correct value.", "input_type": "code", "default_value": "0.2", "evaluate": true}, {"name": "close", "label": "% Accuracy for close.", "help_url": "", "hint": "Question will be considered close if the scalar part of the student's answer is within this % of correct value.", "input_type": "code", "default_value": "1.0", "evaluate": true}, {"name": "C1", "label": "Close with units.", "help_url": "", "hint": "Partial Credit for close value with appropriate units. if correct answer is 100 N and close is ±1%,Find the reactions for a beam with a uniformly distributed load.
", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "statement": "{loadDiagram}
\nA $\\var{distance(L)}$ long beam is subjected uniformly distributed load, as shown. Assume the weight of the beam is negligible.
\nw: {loading} W: {w} $F_A$: {FA} $F_B$ {FB}
", "advice": "midpoint of load
", "templateType": "anything", "can_override": false}, "loading": {"name": "loading", "group": "inputs", "definition": "random(1,2,3,4,5,6)* random(10, 20, 50, 100)", "description": "magnitude of distributed loading [force/length]
", "templateType": "anything", "can_override": false}, "D": {"name": "D", "group": "inputs", "definition": "random(C..L)", "description": "distributed load ends here
\nD-C > 3 and B-A > L/2 and A<>C and B<>D
", "templateType": "anything", "can_override": false}, "C": {"name": "C", "group": "inputs", "definition": "random(0..L/2)", "description": "distributed load starts here
", "templateType": "anything", "can_override": false}, "FA": {"name": "FA", "group": "Ungrouped variables", "definition": "W-FB", "description": "reaction at A
", "templateType": "anything", "can_override": false}, "B": {"name": "B", "group": "inputs", "definition": "random(L/2..L)", "description": "location of right hand support
", "templateType": "anything", "can_override": false}, "W": {"name": "W", "group": "Ungrouped variables", "definition": "loading * (D-C)", "description": "Downward force
", "templateType": "anything", "can_override": false}, "L": {"name": "L", "group": "inputs", "definition": "random(8,10,12,14,16)", "description": "length of beam
", "templateType": "anything", "can_override": false}, "debug": {"name": "debug", "group": "Ungrouped variables", "definition": "false", "description": "", "templateType": "anything", "can_override": false}, "FB": {"name": "FB", "group": "Ungrouped variables", "definition": "(x-A) * W / (B-A)\n", "description": "reaction at B
", "templateType": "anything", "can_override": false}, "units": {"name": "units", "group": "inputs", "definition": "random(['lb','ft', 'lb/ft'],['N','m', 'N/m'])", "description": "", "templateType": "anything", "can_override": false}, "A": {"name": "A", "group": "inputs", "definition": "random(0..L/2)", "description": "location of left hand support
", "templateType": "anything", "can_override": false}, "Force": {"name": "Force", "group": "Ungrouped variables", "definition": "(f)-> siground(qty(F,units[0]),4)", "description": "", "templateType": "anything", "can_override": false}, "distance": {"name": "distance", "group": "Ungrouped variables", "definition": "(d)-> siground(qty(d,units[1]),4)", "description": "", "templateType": "anything", "can_override": false}, "udl": {"name": "udl", "group": "Ungrouped variables", "definition": "(w)->siground(qty(w,units[2]),4)", "description": "", "templateType": "anything", "can_override": false}, "loadProperties": {"name": "loadProperties", "group": "diagrams", "definition": "[ beamLength: L, symbols: LoadSymbols, loads: loads, reactions: [], forces: [], moments: []]", "description": "", "templateType": "anything", "can_override": false}, "loadDiagram": {"name": "loadDiagram", "group": "diagrams", "definition": "vmloaddiagram(loadProperties)", "description": "", "templateType": "anything", "can_override": false}, "loadSymbols": {"name": "loadSymbols", "group": "diagrams", "definition": "[[type: \"pin\", x: A ,label: \"$R_A$\", visible: true], [type: \"roller\", x: b, label: \"$R_B$\", visible: true]]", "description": "", "templateType": "anything", "can_override": false}, "fbdproperties": {"name": "fbdproperties", "group": "diagrams", "definition": "[beamLength: L, reactions: FBDreactions, forces: FBDforces, moments: [], loads: fbdLoads, symbols: [[type: \"dot\", x: x ,label: string(distance(x)), visible: true]]]", "description": "", "templateType": "anything", "can_override": false}, "FBDforces": {"name": "FBDforces", "group": "diagrams", "definition": "[[x: x, value: W, label: \"$W_R$\", visible: true]]", "description": "", "templateType": "anything", "can_override": false}, "FBDreactions": {"name": "FBDreactions", "group": "diagrams", "definition": "[[x: A, value: FA, label: \"$A$\", visible: true],[x: B, value: FB, label: \"$B$\", visible: true]]", "description": "", "templateType": "anything", "can_override": false}, "fbd": {"name": "fbd", "group": "diagrams", "definition": "vmloaddiagram(fbdproperties)", "description": "", "templateType": "anything", "can_override": false}, "fbdLoads": {"name": "fbdLoads", "group": "diagrams", "definition": "[[[x: C, value: 1, label:\"\", visible: false],[x: D, value: 1, label: \"\", visible: false]]]", "description": "", "templateType": "anything", "can_override": false}, "loads": {"name": "loads", "group": "diagrams", "definition": "[[[x: C, value: 1, label: string(udl(loading)), visible: true],[x: D, value: 1, label: \"\", visible: true]]]", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "D-C > 3 and B-A > L/2 and A<>C and B<>D", "maxRuns": 100}, "ungrouped_variables": ["W", "FB", "x", "FA", "debug", "Force", "distance", "udl"], "variable_groups": [{"name": "inputs", "variables": ["A", "B", "C", "D", "loading", "units", "L"]}, {"name": "diagrams", "variables": ["loadProperties", "loads", "loadDiagram", "loadSymbols", "fbdproperties", "FBDforces", "FBDreactions", "fbd", "fbdLoads"]}, {"name": "Unnamed group", "variables": []}], "functions": {}, "preamble": {"js": "", "css": ".jsxgraph-board {width: 200px; height: 100px;}"}, "parts": [{"type": "gapfill", "useCustomName": true, "customName": "Reactions", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Determine the reactions at $A$ and $B$.
\n$A$ = [[0]] $B$ = [[1]]
", "gaps": [{"type": "engineering-answer", "useCustomName": true, "customName": "A", "marks": "10", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "settings": {"correctAnswer": "force(FA)", "right": "0.1", "close": "1.0", "C1": "80", "C2": "80", "C3": "60"}}, {"type": "engineering-answer", "useCustomName": true, "customName": "B", "marks": "10", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "settings": {"correctAnswer": "force(FB)", "right": "0.1", "close": "1.0", "C1": "80", "C2": "80", "C3": "60"}}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "Reactions for beam with uniformly varying load", "extensions": ["jsxgraph", "quantities", "shear-and-bending-moment-diagrams"], "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.
", "help_url": "", "input_widget": "string", "input_options": {"correctAnswer": "siground(settings['correctAnswer'],4)", "hint": {"static": true, "value": ""}, "allowEmpty": {"static": true, "value": true}}, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\nswitch( \n right and good_units and right_sign, add_credit(1.0,'Correct.'),\n right and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\n right and right_sign and not good_units, add_credit(settings['C2'],'Correct value, but wrong or missing units.'),\n close and good_units, add_credit(settings['C1'],'Close.'),\n close and not good_units, add_credit(settings['C3'],'Answer is close, but wrong or missing units.'),\n incorrect('Wrong answer.')\n)\n\ninterpreted_answer:\nqty(student_scalar, student_units)\n\n\n\ncorrect_quantity:\nsettings[\"correctAnswer\"]\n\n\n\ncorrect_units:\nunits(correct_quantity)\n\n\nallowed_notation_styles:\n[\"plain\",\"en\"]\n\nmatch_student_number:\nmatchnumber(studentAnswer,allowed_notation_styles)\n\nstudent_scalar:\nmatch_student_number[1]\n\nstudent_units:\nreplace_regex('ohms','ohm',\n replace_regex('\u00b0', ' deg',\n replace_regex('-', ' ' ,\n studentAnswer[len(match_student_number[0])..len(studentAnswer)])),\"i\")\n\ngood_units:\ntry(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n\n\nstudent_quantity:\nswitch(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\n\npercent_error:\ntry(\nscalar(abs((correct_quantity - student_quantity)/correct_quantity))*100 \n,msg,\nif(student_quantity=correct_quantity,0,100))\n \n\nright:\npercent_error <= settings['right']\n\n\nclose:\nright_sign and percent_error <= settings['close']\n\nright_sign:\nsign(student_scalar) = sign(correct_quantity)", "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": "switch( \n right and good_units and right_sign, add_credit(1.0,'Correct.'),\n right and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\n right and right_sign and not good_units, add_credit(settings['C2'],'Correct value, but wrong or missing units.'),\n close and good_units, add_credit(settings['C1'],'Close.'),\n close and not good_units, add_credit(settings['C3'],'Answer is close, but wrong or missing units.'),\n incorrect('Wrong answer.')\n)"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "qty(student_scalar, student_units)\n\n"}, {"name": "correct_quantity", "description": "", "definition": "settings[\"correctAnswer\"]\n\n"}, {"name": "correct_units", "description": "", "definition": "units(correct_quantity)\n"}, {"name": "allowed_notation_styles", "description": "", "definition": "[\"plain\",\"en\"]"}, {"name": "match_student_number", "description": "", "definition": "matchnumber(studentAnswer,allowed_notation_styles)"}, {"name": "student_scalar", "description": "", "definition": "match_student_number[1]"}, {"name": "student_units", "description": "Modify the unit portion of the student's answer by
\n1. replacing \"ohms\" with \"ohm\" case insensitive
\n2. replacing '-' with ' '
\n3. replacing '°' with ' deg'
\nto allow answers like 10 ft-lb and 30°
", "definition": "replace_regex('ohms','ohm',\n replace_regex('\u00b0', ' deg',\n replace_regex('-', ' ' ,\n studentAnswer[len(match_student_number[0])..len(studentAnswer)])),\"i\")"}, {"name": "good_units", "description": "", "definition": "try(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n"}, {"name": "student_quantity", "description": "This fixes the student answer for two common errors.
\nIf student_units are wrong - replace with correct units
\nIf student_scalar has the wrong sign - replace with right sign
\nIf student makes both errors, only one gets fixed.
", "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"}, {"name": "percent_error", "description": "", "definition": "try(\nscalar(abs((correct_quantity - student_quantity)/correct_quantity))*100 \n,msg,\nif(student_quantity=correct_quantity,0,100))\n "}, {"name": "right", "description": "", "definition": "percent_error <= settings['right']\n"}, {"name": "close", "description": "Only marked close if the student actually has the right sign.
", "definition": "right_sign and percent_error <= settings['close']"}, {"name": "right_sign", "description": "", "definition": "sign(student_scalar) = sign(correct_quantity) "}], "settings": [{"name": "correctAnswer", "label": "Correct Quantity.", "help_url": "", "hint": "The correct answer given as a JME quantity.", "input_type": "code", "default_value": "", "evaluate": true}, {"name": "right", "label": "% Accuracy for right.", "help_url": "", "hint": "Question will be considered correct if the scalar part of the student's answer is within this % of correct value.", "input_type": "code", "default_value": "0.2", "evaluate": true}, {"name": "close", "label": "% Accuracy for close.", "help_url": "", "hint": "Question will be considered close if the scalar part of the student's answer is within this % of correct value.", "input_type": "code", "default_value": "1.0", "evaluate": true}, {"name": "C1", "label": "Close with units.", "help_url": "", "hint": "Partial Credit for close value with appropriate units. if correct answer is 100 N and close is ±1%,Find the reactions for a beam with a uniformly varying distributed load.
", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "statement": "{loadDiagram}
\nA {qty(L, units[1]) } long beam is subjected to a load which varies uniformly from $\\var{uvl(wc)}$ at $C$ to $\\var{uvl(wd)}$ at $D$. The beam itself weighs $\\var{uvl(w_b)}$.
\nW: {w} beam: {wb} xbar: {x} check: {check}
\n$F_A$: {precround(FA,4)} $F_B$ {precround(FB,4)}
", "advice": "distributed load ends here
", "templateType": "anything", "can_override": false}, "L": {"name": "L", "group": "inputs", "definition": "random(10,15, 18)", "description": "length of beam
\n", "templateType": "anything", "can_override": false}, "units": {"name": "units", "group": "inputs", "definition": "random(['lb', 'ft', 'lb/ft'],['kN', 'm', 'kN/m'])", "description": "", "templateType": "anything", "can_override": false}, "loading": {"name": "loading", "group": "inputs", "definition": "random(10..50#10)", "description": "distributed loading [force/length]
", "templateType": "anything", "can_override": false}, "FA": {"name": "FA", "group": "Ungrouped variables", "definition": "(W + WB)-FB", "description": "reaction at A
", "templateType": "anything", "can_override": false}, "debug": {"name": "debug", "group": "Ungrouped variables", "definition": "false", "description": "", "templateType": "anything", "can_override": false}, "wc": {"name": "wc", "group": "inputs", "definition": "random(0..2#0.5 except 0.5) loading", "description": "", "templateType": "anything", "can_override": false}, "W": {"name": "W", "group": "Ungrouped variables", "definition": "precround((wc+wd)/2 * (D-C),5)", "description": "Downward force due to load
", "templateType": "anything", "can_override": false}, "B": {"name": "B", "group": "inputs", "definition": "if(D=L, random(L-1..L-4), L)", "description": "location of right hand support
", "templateType": "anything", "can_override": false}, "C": {"name": "C", "group": "inputs", "definition": "random(0..5)", "description": "distributed load starts here
", "templateType": "anything", "can_override": false}, "A": {"name": "A", "group": "inputs", "definition": "if(C=0, random(1..4), 0)", "description": "location of left hand support
", "templateType": "anything", "can_override": false}, "wd": {"name": "wd", "group": "inputs", "definition": "random(0..2#0.5 except 0.5) loading", "description": "", "templateType": "anything", "can_override": false}, "x": {"name": "x", "group": "Ungrouped variables", "definition": "C + (wc / 6 + wd/ 3)(D-C) * 2/(wc+wd)", "description": "midpoint of load
", "templateType": "anything", "can_override": false}, "FB": {"name": "FB", "group": "Ungrouped variables", "definition": "precround(((x-A) * W + (CG-A) * WB) / (B-A),5)\n", "description": "reaction at B
", "templateType": "anything", "can_override": false}, "w_b": {"name": "w_b", "group": "inputs", "definition": "siground(random(0.1..1 #0.1) loading,3)", "description": "Weight of the beam in W/L units
", "templateType": "anything", "can_override": false}, "CG": {"name": "CG", "group": "Ungrouped variables", "definition": "L/2", "description": "center of the beam
", "templateType": "anything", "can_override": false}, "WB": {"name": "WB", "group": "Ungrouped variables", "definition": "w_b L ", "description": "Weight of the beam itself
", "templateType": "anything", "can_override": false}, "check": {"name": "check", "group": "Ungrouped variables", "definition": "(W + WB)= (FA+FB)", "description": "", "templateType": "anything", "can_override": false}, "points": {"name": "points", "group": "inputs", "definition": "sort(deal(L)[0..2])", "description": "", "templateType": "anything", "can_override": false}, "properties": {"name": "properties", "group": "Unnamed group", "definition": "[beamLength: L, loads: distributedLoad, symbols: symbols, forces: [], moments: [], reactions: []]", "description": "", "templateType": "anything", "can_override": false}, "loadDiagram": {"name": "loadDiagram", "group": "Unnamed group", "definition": "vmloaddiagram(properties)", "description": "", "templateType": "anything", "can_override": false}, "symbols": {"name": "symbols", "group": "Unnamed group", "definition": "[[x: A, type: \"pin\", label: \"$A$\", visible: true],[x: B, type: \"roller\", label: \"$B$\", visible: true], [x: C, type: \"dot\", label: \"$C$\", visible: true], [x: D, type: \"dot\", label: \"$D$\", visible: true]]\n", "description": "", "templateType": "anything", "can_override": false}, "distributedLoad": {"name": "distributedLoad", "group": "Unnamed group", "definition": "[[[x: C, value: wC , label: loadWords(wc,wd), visible: true], [x: D, value: wd , label: \"\", visible: true]]]", "description": "", "templateType": "anything", "can_override": false}, "loadWords": {"name": "loadWords", "group": "Unnamed group", "definition": "(w1,w2) -> w1 + \" to \" + w2 + \" \" + units[2]", "description": "", "templateType": "anything", "can_override": false}, "UVL": {"name": "UVL", "group": "Unnamed group", "definition": "w -> qty(w, units[2])", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "D-C > L/3 and \nwc<>wd", "maxRuns": 100}, "ungrouped_variables": ["W", "FB", "x", "FA", "debug", "CG", "WB", "check"], "variable_groups": [{"name": "inputs", "variables": ["A", "B", "C", "D", "loading", "units", "L", "wc", "wd", "w_b", "points"]}, {"name": "ggb", "variables": []}, {"name": "Unnamed group", "variables": ["properties", "loadDiagram", "symbols", "distributedLoad", "loadWords", "UVL"]}], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": true, "customName": "Find Reactions", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Determine the reactions at $A$ and $B$.
\n$A$ = [[0]]
\n$B$ = [[1]]
", "gaps": [{"type": "engineering-answer", "useCustomName": true, "customName": "A", "marks": "10", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "settings": {"correctAnswer": "qty(precround(FA,4),units[0])", "right": "0.1", "close": "1.0", "C1": "80", "C2": "80", "C3": "60"}}, {"type": "engineering-answer", "useCustomName": true, "customName": "B", "marks": "10", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "settings": {"correctAnswer": "qty(siground(FB,4),units[0])", "right": "0.1", "close": "1.0", "C1": "80", "C2": "80", "C3": "60"}}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "Distributed Loads: trapezoidal loading", "extensions": ["jsxgraph", "quantities", "shear-and-bending-moment-diagrams"], "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.
", "help_url": "", "input_widget": "string", "input_options": {"correctAnswer": "siground(settings['correctAnswer'],4)", "hint": {"static": true, "value": ""}, "allowEmpty": {"static": true, "value": true}}, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\nswitch( \n right and good_units and right_sign, add_credit(1.0,'Correct.'),\n right and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\n right and right_sign and not good_units, add_credit(settings['C2'],'Correct value, but wrong or missing units.'),\n close and good_units, add_credit(settings['C1'],'Close.'),\n close and not good_units, add_credit(settings['C3'],'Answer is close, but wrong or missing units.'),\n incorrect('Wrong answer.')\n)\n\ninterpreted_answer:\nqty(student_scalar, student_units)\n\n\n\ncorrect_quantity:\nsettings[\"correctAnswer\"]\n\n\n\ncorrect_units:\nunits(correct_quantity)\n\n\nallowed_notation_styles:\n[\"plain\",\"en\"]\n\nmatch_student_number:\nmatchnumber(studentAnswer,allowed_notation_styles)\n\nstudent_scalar:\nmatch_student_number[1]\n\nstudent_units:\nreplace_regex('ohms','ohm',\n replace_regex('\u00b0', ' deg',\n replace_regex('-', ' ' ,\n studentAnswer[len(match_student_number[0])..len(studentAnswer)])),\"i\")\n\ngood_units:\ntry(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n\n\nstudent_quantity:\nswitch(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\n\npercent_error:\ntry(\nscalar(abs((correct_quantity - student_quantity)/correct_quantity))*100 \n,msg,\nif(student_quantity=correct_quantity,0,100))\n \n\nright:\npercent_error <= settings['right']\n\n\nclose:\nright_sign and percent_error <= settings['close']\n\nright_sign:\nsign(student_scalar) = sign(correct_quantity)", "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": "switch( \n right and good_units and right_sign, add_credit(1.0,'Correct.'),\n right and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\n right and right_sign and not good_units, add_credit(settings['C2'],'Correct value, but wrong or missing units.'),\n close and good_units, add_credit(settings['C1'],'Close.'),\n close and not good_units, add_credit(settings['C3'],'Answer is close, but wrong or missing units.'),\n incorrect('Wrong answer.')\n)"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "qty(student_scalar, student_units)\n\n"}, {"name": "correct_quantity", "description": "", "definition": "settings[\"correctAnswer\"]\n\n"}, {"name": "correct_units", "description": "", "definition": "units(correct_quantity)\n"}, {"name": "allowed_notation_styles", "description": "", "definition": "[\"plain\",\"en\"]"}, {"name": "match_student_number", "description": "", "definition": "matchnumber(studentAnswer,allowed_notation_styles)"}, {"name": "student_scalar", "description": "", "definition": "match_student_number[1]"}, {"name": "student_units", "description": "Modify the unit portion of the student's answer by
\n1. replacing \"ohms\" with \"ohm\" case insensitive
\n2. replacing '-' with ' '
\n3. replacing '°' with ' deg'
\nto allow answers like 10 ft-lb and 30°
", "definition": "replace_regex('ohms','ohm',\n replace_regex('\u00b0', ' deg',\n replace_regex('-', ' ' ,\n studentAnswer[len(match_student_number[0])..len(studentAnswer)])),\"i\")"}, {"name": "good_units", "description": "", "definition": "try(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n"}, {"name": "student_quantity", "description": "This fixes the student answer for two common errors.
\nIf student_units are wrong - replace with correct units
\nIf student_scalar has the wrong sign - replace with right sign
\nIf student makes both errors, only one gets fixed.
", "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"}, {"name": "percent_error", "description": "", "definition": "try(\nscalar(abs((correct_quantity - student_quantity)/correct_quantity))*100 \n,msg,\nif(student_quantity=correct_quantity,0,100))\n "}, {"name": "right", "description": "", "definition": "percent_error <= settings['right']\n"}, {"name": "close", "description": "Only marked close if the student actually has the right sign.
", "definition": "right_sign and percent_error <= settings['close']"}, {"name": "right_sign", "description": "", "definition": "sign(student_scalar) = sign(correct_quantity) "}], "settings": [{"name": "correctAnswer", "label": "Correct Quantity.", "help_url": "", "hint": "The correct answer given as a JME quantity.", "input_type": "code", "default_value": "", "evaluate": true}, {"name": "right", "label": "% Accuracy for right.", "help_url": "", "hint": "Question will be considered correct if the scalar part of the student's answer is within this % of correct value.", "input_type": "code", "default_value": "0.2", "evaluate": true}, {"name": "close", "label": "% Accuracy for close.", "help_url": "", "hint": "Question will be considered close if the scalar part of the student's answer is within this % of correct value.", "input_type": "code", "default_value": "1.0", "evaluate": true}, {"name": "C1", "label": "Close with units.", "help_url": "", "hint": "Partial Credit for close value with appropriate units. if correct answer is 100 N and close is ±1%,Find the reactions of a simply-supported beam with a trapazoidal distributed load.
", "licence": "Creative Commons Attribution-ShareAlike 4.0 International"}, "statement": "{loadDiagram}
\n$\\var{distance(L)}$ long beam $AB$ is subjected to a distributed load which varies as shown.
\nDetermine the reactions at $A$ and $B$.
", "advice": "\n$\\begin{align}\\\\ L &= \\var{distance(L)}\\\\W_R &= \\var{force(xr)} & x_R &= \\var{distance(xr)} \\\\
W_T &= \\var{force(wt)} &x_T &= \\var{distance(xt)}\\end{align}$
Draw a free body diagram of the beam, replacing the distributed loads with equivalent concentrated loads at the centroids of the triangle and rectangle.
\n{fbd}
\n$\\begin{align}\\\\
\\Sigma M_A &= 0 \\\\
W_R (x_r) + W_T (x_T) &= B (L )\\\\
B &= \\frac{W_R( x_r) + W_T( x_T)}{L} \\\\
&= \\var{force(rb)} \\\\ \\\\
\\Sigma F_y &= 0 \\\\ A + B &= W_T + W_R \\\\ A &= W_T + W_R - B \\\\
&= \\var{force(ra)} \\end{align}$
Max value of loading in [force/distance]
", "templateType": "anything", "can_override": false}, "WT": {"name": "WT", "group": "solution", "definition": "triangle_base w /2", "description": "weight of the triangular load
", "templateType": "anything", "can_override": false}, "WR": {"name": "WR", "group": "solution", "definition": "rectangle_base w", "description": "weight of the rectangular load
", "templateType": "anything", "can_override": false}, "WTot": {"name": "WTot", "group": "solution", "definition": "WT + WR", "description": "Total weight of load
", "templateType": "anything", "can_override": false}, "xR": {"name": "xR", "group": "solution", "definition": "rectangle_base/2 + rectangle[0]", "description": "location of centroid of rect
", "templateType": "anything", "can_override": false}, "xT": {"name": "xT", "group": "solution", "definition": "if(type=0,triangle_base/3, 2 triangle_base/3) + triangle[0]\n ", "description": "Centroid of triangle
", "templateType": "anything", "can_override": false}, "L": {"name": "L", "group": "Ungrouped variables", "definition": "random([16,20,24])", "description": "length of beam
", "templateType": "anything", "can_override": false}, "units": {"name": "units", "group": "Ungrouped variables", "definition": "random([['ft','lb', 'lb/ft'],['m','kN', 'kN/m']])", "description": "", "templateType": "anything", "can_override": false}, "RB": {"name": "RB", "group": "solution", "definition": "(WR xR + WT xT)/ L", "description": "", "templateType": "anything", "can_override": false}, "RA": {"name": "RA", "group": "solution", "definition": "(WT * (L-xT) + WR * (L-xR ))/ L", "description": "", "templateType": "anything", "can_override": false}, "check": {"name": "check", "group": "solution", "definition": "RA + RB = Wtot", "description": "", "templateType": "anything", "can_override": false}, "properties": {"name": "properties", "group": "diagram", "definition": "[beamLength: L, loads: loads, symbols: symbols , forces: [], moments: [], reactions: []]", "description": "", "templateType": "anything", "can_override": false}, "loads": {"name": "loads", "group": "diagram", "definition": "[\n[ [x: rectangle[0], value: w, label: w + \" \" + units[2], visible: true], \n [x: rectangle[1], value: w, label: \"\" ] ],\n[ [x: triangle[0], value: if(type=0,w,0), label: \"\" , visible: true], \n [x: triangle[1], value: if(type=0,0,w), label: \"\" ]\n]\n]\n", "description": "choses between triangle-rectangle and rectangle triangle
", "templateType": "anything", "can_override": false}, "symbols": {"name": "symbols", "group": "diagram", "definition": "[[type: \"pin\", x: 0, label: \"$A$\", visible: true], [type: \"roller\", x: L, label: \"$B$\", visible: true]]", "description": "", "templateType": "anything", "can_override": false}, "LoadDiagram": {"name": "LoadDiagram", "group": "diagram", "definition": "vmloaddiagram(properties)", "description": "", "templateType": "anything", "can_override": false}, "uniquePoint": {"name": "uniquePoint", "group": "Ungrouped variables", "definition": "sort(shuffle(0..L)[0..3])", "description": "", "templateType": "anything", "can_override": false}, "type": {"name": "type", "group": "Ungrouped variables", "definition": "random(0,1)", "description": "0 = rect then triangle
\n1 = triangle then rect
", "templateType": "anything", "can_override": false}, "Rectangle": {"name": "Rectangle", "group": "Ungrouped variables", "definition": "if(type=0,\n [load_start, load_start+ rectangle_base],\n [load_start+triangle_base, load_start+triangle_base+rectangle_base])", "description": "", "templateType": "anything", "can_override": false}, "triangle": {"name": "triangle", "group": "Ungrouped variables", "definition": "if(type=0,\n [load_start+rectangle_base, load_start+ rectangle_base + triangle_base],\n [load_start, load_start+triangle_base])", "description": "", "templateType": "anything", "can_override": false}, "Triangle_base": {"name": "Triangle_base", "group": "Ungrouped variables", "definition": "6", "description": "", "templateType": "anything", "can_override": false}, "rectangle_base": {"name": "rectangle_base", "group": "Ungrouped variables", "definition": "random(4..L-triangle_base)", "description": "", "templateType": "anything", "can_override": false}, "Load_start": {"name": "Load_start", "group": "Ungrouped variables", "definition": "random(0..L-triangle_base-rectangle_base)", "description": "", "templateType": "anything", "can_override": false}, "distance": {"name": "distance", "group": "quantities", "definition": "d -> qty(d, units[0])", "description": "", "templateType": "anything", "can_override": false}, "force": {"name": "force", "group": "quantities", "definition": "f -> siground(qty(f,units[1]),4)", "description": "", "templateType": "anything", "can_override": false}, "load": {"name": "load", "group": "quantities", "definition": "w -> qty(w,units[2])", "description": "", "templateType": "anything", "can_override": false}, "FBDProperties": {"name": "FBDProperties", "group": "diagram", "definition": "[beamLength: L, reactions: fbdReactions, loads: fbdloads, symbols: fbdsymbols, moments: [], forces: fbdEquivalentloads]", "description": "", "templateType": "anything", "can_override": false}, "FBDSymbols": {"name": "FBDSymbols", "group": "diagram", "definition": "[[type: \"dot\", x: xt, label: xt, visible: true], [type: \"dot\", x: xr, label: xr, visible: true]]", "description": "", "templateType": "anything", "can_override": false}, "fbd": {"name": "fbd", "group": "diagram", "definition": "vmloaddiagram(fbdproperties)", "description": "", "templateType": "anything", "can_override": false}, "fbdReactions": {"name": "fbdReactions", "group": "diagram", "definition": "[[x: 0, value: ra, label: \"$A$\", visible: true], [x: L, value: rb, label: \"$B$\", visible: true]]\n", "description": "", "templateType": "anything", "can_override": false}, "fbdEquivalentLoads": {"name": "fbdEquivalentLoads", "group": "diagram", "definition": "[[x: xr, value: wr, label: \"$W_R$\", visible: true], [x: xt, value: wt, label: \"$W_T$\", visible: true]]", "description": "", "templateType": "anything", "can_override": false}, "fbdLoads": {"name": "fbdLoads", "group": "diagram", "definition": "[\n[ [x: rectangle[0], value: w, label: \"\" , visible: false], \n [x: rectangle[1], value: w, label: \"\" ] ],\n[ [x: triangle[0], value: if(type=0,w,0), label: \"\" , visible: false], \n [x: triangle[1], value: if(type=0,0,w), label: \"\" ]\n]\n]\n", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["w", "L", "units", "uniquePoint", "type", "Rectangle", "triangle", "Triangle_base", "rectangle_base", "Load_start"], "variable_groups": [{"name": "solution", "variables": ["WT", "WR", "WTot", "xR", "xT", "RB", "RA", "check"]}, {"name": "quantities", "variables": ["distance", "force", "load"]}, {"name": "diagram", "variables": ["properties", "loads", "symbols", "FBDProperties", "FBDSymbols", "fbdReactions", "fbdEquivalentLoads", "fbdLoads", "fbd", "LoadDiagram"]}], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": true, "customName": "Find Reactions", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "$A = $ [[0]]
$B = $ [[1]]
A value with units marked right if within an adjustable % error of the correct value. Marked close if within a wider margin of error.
", "help_url": "", "input_widget": "string", "input_options": {"correctAnswer": "siground(settings['correctAnswer'],4)", "hint": {"static": true, "value": ""}, "allowEmpty": {"static": true, "value": true}}, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\nswitch( \n right and good_units and right_sign, add_credit(1.0,'Correct.'),\n right and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\n right and right_sign and not good_units, add_credit(settings['C2'],'Correct value, but wrong or missing units.'),\n close and good_units, add_credit(settings['C1'],'Close.'),\n close and not good_units, add_credit(settings['C3'],'Answer is close, but wrong or missing units.'),\n incorrect('Wrong answer.')\n)\n\ninterpreted_answer:\nqty(student_scalar, student_units)\n\n\n\ncorrect_quantity:\nsettings[\"correctAnswer\"]\n\n\n\ncorrect_units:\nunits(correct_quantity)\n\n\nallowed_notation_styles:\n[\"plain\",\"en\"]\n\nmatch_student_number:\nmatchnumber(studentAnswer,allowed_notation_styles)\n\nstudent_scalar:\nmatch_student_number[1]\n\nstudent_units:\nreplace_regex('ohms','ohm',\n replace_regex('\u00b0', ' deg',\n replace_regex('-', ' ' ,\n studentAnswer[len(match_student_number[0])..len(studentAnswer)])),\"i\")\n\ngood_units:\ntry(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n\n\nstudent_quantity:\nswitch(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\n\npercent_error:\ntry(\nscalar(abs((correct_quantity - student_quantity)/correct_quantity))*100 \n,msg,\nif(student_quantity=correct_quantity,0,100))\n \n\nright:\npercent_error <= settings['right']\n\n\nclose:\nright_sign and percent_error <= settings['close']\n\nright_sign:\nsign(student_scalar) = sign(correct_quantity)", "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": "switch( \n right and good_units and right_sign, add_credit(1.0,'Correct.'),\n right and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\n right and right_sign and not good_units, add_credit(settings['C2'],'Correct value, but wrong or missing units.'),\n close and good_units, add_credit(settings['C1'],'Close.'),\n close and not good_units, add_credit(settings['C3'],'Answer is close, but wrong or missing units.'),\n incorrect('Wrong answer.')\n)"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "qty(student_scalar, student_units)\n\n"}, {"name": "correct_quantity", "description": "", "definition": "settings[\"correctAnswer\"]\n\n"}, {"name": "correct_units", "description": "", "definition": "units(correct_quantity)\n"}, {"name": "allowed_notation_styles", "description": "", "definition": "[\"plain\",\"en\"]"}, {"name": "match_student_number", "description": "", "definition": "matchnumber(studentAnswer,allowed_notation_styles)"}, {"name": "student_scalar", "description": "", "definition": "match_student_number[1]"}, {"name": "student_units", "description": "Modify the unit portion of the student's answer by
\n1. replacing \"ohms\" with \"ohm\" case insensitive
\n2. replacing '-' with ' '
\n3. replacing '°' with ' deg'
\nto allow answers like 10 ft-lb and 30°
", "definition": "replace_regex('ohms','ohm',\n replace_regex('\u00b0', ' deg',\n replace_regex('-', ' ' ,\n studentAnswer[len(match_student_number[0])..len(studentAnswer)])),\"i\")"}, {"name": "good_units", "description": "", "definition": "try(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n"}, {"name": "student_quantity", "description": "This fixes the student answer for two common errors.
\nIf student_units are wrong - replace with correct units
\nIf student_scalar has the wrong sign - replace with right sign
\nIf student makes both errors, only one gets fixed.
", "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"}, {"name": "percent_error", "description": "", "definition": "try(\nscalar(abs((correct_quantity - student_quantity)/correct_quantity))*100 \n,msg,\nif(student_quantity=correct_quantity,0,100))\n "}, {"name": "right", "description": "", "definition": "percent_error <= settings['right']\n"}, {"name": "close", "description": "Only marked close if the student actually has the right sign.
", "definition": "right_sign and percent_error <= settings['close']"}, {"name": "right_sign", "description": "", "definition": "sign(student_scalar) = sign(correct_quantity) "}], "settings": [{"name": "correctAnswer", "label": "Correct Quantity.", "help_url": "", "hint": "The correct answer given as a JME quantity.", "input_type": "code", "default_value": "", "evaluate": true}, {"name": "right", "label": "% Accuracy for right.", "help_url": "", "hint": "Question will be considered correct if the scalar part of the student's answer is within this % of correct value.", "input_type": "code", "default_value": "0.2", "evaluate": true}, {"name": "close", "label": "% Accuracy for close.", "help_url": "", "hint": "Question will be considered close if the scalar part of the student's answer is within this % of correct value.", "input_type": "code", "default_value": "1.0", "evaluate": true}, {"name": "C1", "label": "Close with units.", "help_url": "", "hint": "Partial Credit for close value with appropriate units. if correct answer is 100 N and close is ±1%,An editable spreadsheet. Ranges of cells can be disabled, and you can specify ranges of cells to be marked. A cell is marked correct if its value is equal to the value in the expected answer spreadsheet.
", "help_url": "", "input_widget": "spread-sheet", "input_options": {"correctAnswer": "settings[\"correct_answer\"]", "hint": {"static": true, "value": ""}, "initial_sheet": {"static": false, "value": "disable_cells(settings[\"initial_sheet\"], settings[\"disable_ranges\"])"}}, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\nif(sum(mark_ranges)=0,\n incorrect(),\n apply(mark_ranges)\n)\n\ninterpreted_answer:\nstudentAnswer\n\nrange_cells:\nmap(parse_range(ref),ref,values(settings[\"mark_ranges\"]))\n\ntotal_cells:\nlen(flatten(range_cells))\n\nrange_weights:\nswitch(\n settings[\"marking_method\"]=\"per_cell\",\n map(len(r)/total_cells, r, range_cells),\n // otherwise, mark per range\n repeat(1/len(range_cells), len(range_cells))\n)\n\nmark_ranges:\nmap(\n let(\n range_credit,\n sum(map(\n let(\n correctCellString, correctAnswer[c],\n correctCellNumber, parsenumber(correctCellString, notation_styles),\n studentCellString, studentAnswer[c],\n studentCellNumber, parsenumber(studentCellString, notation_styles),\n award(\n 1/len(cells), \n switch(\n correctCellString=\"\",\n isnan(studentCellNumber) or studentCellString=\"\",\n isnan(correctCellNumber),\n lower(correctCellString) = lower(studentCellString)\n ,\n abs(studentCellNumber - if(isnan(correctCellNumber),0,correctCellNumber)) <= settings[\"tolerance\"]\n )\n )\n ),\n c,\n cells\n )),\n message,\n switch(\n range_credit=0,\n if(len(cells)=1, \"This entry is incorrect.\", \"All entries in this range are incorrect.\"),\n range_credit=1,\n if(len(cells)=1, \"This entry is correct.\", \"All entries in this range are correct.\"),\n //otherwise\n \"Some entries in this range are correct.\"\n ),\n assert(len(cells)=0, add_credit(range_credit*w, \"{name}: \"+message)); \n range_credit\n ),\n [cells,w,name],\n zip(range_cells, range_weights, keys(settings[\"mark_ranges\"]))\n)\n\nnotation_styles:\n[\"plain\",\"si-en\"]\n\ncorrectAnswer:\nsettings[\"correct_answer\"]", "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(sum(mark_ranges)=0,\n incorrect(),\n apply(mark_ranges)\n)"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "studentAnswer"}, {"name": "range_cells", "description": "For each range to be marked, the addresses of the cells in that range.
", "definition": "map(parse_range(ref),ref,values(settings[\"mark_ranges\"]))"}, {"name": "total_cells", "description": "The total number of cells to be marked. Cells in overlapping ranges will be counted once for each range they're in.
", "definition": "len(flatten(range_cells))"}, {"name": "range_weights", "description": "The weight of each range, as a proportion of the available credit.
", "definition": "switch(\n settings[\"marking_method\"]=\"per_cell\",\n map(len(r)/total_cells, r, range_cells),\n // otherwise, mark per range\n repeat(1/len(range_cells), len(range_cells))\n)"}, {"name": "mark_ranges", "description": "Mark each of the ranges specified by the question author.
", "definition": "map(\n let(\n range_credit,\n sum(map(\n let(\n correctCellString, correctAnswer[c],\n correctCellNumber, parsenumber(correctCellString, notation_styles),\n studentCellString, studentAnswer[c],\n studentCellNumber, parsenumber(studentCellString, notation_styles),\n award(\n 1/len(cells), \n switch(\n correctCellString=\"\",\n isnan(studentCellNumber) or studentCellString=\"\",\n isnan(correctCellNumber),\n lower(correctCellString) = lower(studentCellString)\n ,\n abs(studentCellNumber - if(isnan(correctCellNumber),0,correctCellNumber)) <= settings[\"tolerance\"]\n )\n )\n ),\n c,\n cells\n )),\n message,\n switch(\n range_credit=0,\n if(len(cells)=1, \"This entry is incorrect.\", \"All entries in this range are incorrect.\"),\n range_credit=1,\n if(len(cells)=1, \"This entry is correct.\", \"All entries in this range are correct.\"),\n //otherwise\n \"Some entries in this range are correct.\"\n ),\n assert(len(cells)=0, add_credit(range_credit*w, \"{name}: \"+message)); \n range_credit\n ),\n [cells,w,name],\n zip(range_cells, range_weights, keys(settings[\"mark_ranges\"]))\n)"}, {"name": "notation_styles", "description": "Accepted number notation styles for a value in an individual cell.
", "definition": "[\"plain\",\"si-en\"]"}, {"name": "correctAnswer", "description": "", "definition": "settings[\"correct_answer\"]"}], "settings": [{"name": "initial_sheet", "label": "Initial sheet", "help_url": "", "hint": "Aspreadsheet object giving the initial state of the sheet that the student should fill in.", "input_type": "code", "default_value": "", "evaluate": true}, {"name": "correct_answer", "label": "Correct answer", "help_url": "", "hint": "A spreadsheet object representing a correct answer to the part.", "input_type": "code", "default_value": "", "evaluate": true}, {"name": "disable_ranges", "label": "Ranges to disable", "help_url": "", "hint": "A list of cell or range references, denoting the cells that should not be editable.", "input_type": "code", "default_value": "[]", "evaluate": true}, {"name": "mark_ranges", "label": "Ranges to mark", "help_url": "", "hint": "A dictionary of cell or range references, mapping names to ranges of cells, denoting the cells that should be compared for equality with the expected answer.", "input_type": "code", "default_value": "dict()", "evaluate": true}, {"name": "marking_method", "label": "Marking method", "help_url": "", "hint": "", "input_type": "dropdown", "default_value": "per_cell", "choices": [{"value": "per_cell", "label": "Each cell has the same weight"}, {"value": "per_range", "label": "Each range has the same weight"}]}, {"name": "tolerance", "label": "Allowed margin of error", "help_url": "", "hint": "", "input_type": "code", "default_value": "0", "evaluate": true}], "public_availability": "always", "published": true, "extensions": ["sheets"]}], "resources": [["question-resources/centroids.png", "/srv/numbas/media/question-resources/centroids.png"], ["question-resources/centroids_3A0rXlj.png", "/srv/numbas/media/question-resources/centroids_3A0rXlj.png"], ["question-resources/centroids_zSOgoBb.png", "/srv/numbas/media/question-resources/centroids_zSOgoBb.png"], ["question-resources/centroid-t-r.ggb", "/srv/numbas/media/question-resources/centroid-t-r.ggb"], ["question-resources/centroid-integration.ggb", "/srv/numbas/media/question-resources/centroid-integration.ggb"], ["question-resources/dist-load.ggb", "/srv/numbas/media/question-resources/dist-load.ggb"]]}