// Numbas version: finer_feedback_settings {"name": "Saw Tooth Fourier Series Attempt 3", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Saw Tooth Fourier Series Attempt 3", "statement": "", "variable_groups": [], "extensions": ["jsxgraph"], "advice": "", "variablesTest": {"maxRuns": 100, "condition": ""}, "parts": [{"choices": ["

{answer}%          

", "

{fakeanswer1}%          

", "

{fakeanswer2}%          

", "

{fakeanswer3}%          

", "

{fakeanswer4}%          

"], "maxMarks": 0, "variableReplacementStrategy": "originalfirst", "displayColumns": 0, "showFeedbackIcon": true, "minMarks": 0, "prompt": "

Sketch of function.

", "shuffleChoices": true, "variableReplacements": [], "distractors": ["", "", "", "", ""], "showCorrectAnswer": true, "matrix": ["1", 0, 0, 0, 0], "marks": 0, "scripts": {}, "type": "1_n_2", "displayType": "radiogroup"}], "ungrouped_variables": ["selector", "vsh", "hsh", "vsc", "hsc", "yo", "yn", "xo", "xn", "yo0", "yo1", "yo2", "yo3", "yo4", "maxx", "maxy", "yo01", "yo11", "yo21", "yo31", "yo41", "yo5", "yo51", "maxvector", "a", "b", "c", "d", "eee", "f", "answer", "fakeanswer1", "fakeanswer2", "fakeanswer3", "fakeanswer4", "aa", "bb", "cc", "dd"], "metadata": {"licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International", "description": "

Widget Sales

"}, "rulesets": {"std": ["all", "fractionNumbers"]}, "functions": {}, "tags": [], "preamble": {"js": "function dragpoint_board() {\n var scope = question.scope;\n\n JXG.Options.text.display = 'internal';\n \n var yo0 = scope.variables.yo0.value;\n var yo1 = scope.variables.yo1.value;\n \n var div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',{boundingBox:[-12,12,12,-2], axis:true, grid:false, title:{\n text: \"\"}});\n \n $(question.display.html).find('#dragpoint').append(div);\n \n var board = div.board;\n \n var parabool1 = board.create('line',[[x1=-yo0/2,y1=0], [x2=0,y2=yo1]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n var parabool2 = board.create('line',[[x1=0,y1=yo1], [x2=yo0/2,y2=0]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n \n}\n\nquestion.signals.on('HTMLAttached',function() {\n dragpoint_board();\n});", "css": "table#values th {\n background: none;\n text-align: center;\n}"}, "variables": {"yo31": {"name": "yo31", "definition": "c+yo3", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "yo51": {"name": "yo51", "definition": "eee+yo5", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "answer": {"name": "answer", "definition": "precround((yo11-yo1)/yo11*100,2)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "aa": {"name": "aa", "definition": "random(0.7..1.3#0.01 except 1)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "yo4": {"name": "yo4", "definition": "random(5..12#1 except yo0 except yo1 except yo2 except yo3)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "xo": {"name": "xo", "definition": "list(-2..2)", "templateType": "anything", "description": "

original x values

", "group": "Ungrouped variables"}, "fakeanswer3": {"name": "fakeanswer3", "definition": "precround(cc*answer,2)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "yo": {"name": "yo", "definition": "repeat(random(-5..5),5)", "templateType": "anything", "description": "

the (random) original y values which relate to the x values

", "group": "Ungrouped variables"}, "yo0": {"name": "yo0", "definition": "random(5..12#1)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "xn": {"name": "xn", "definition": "map((x-hsh)/hsc,x,xo)", "templateType": "anything", "description": "

new transformed x values

", "group": "Ungrouped variables"}, "yo5": {"name": "yo5", "definition": "random(4..12#1 except yo0 except yo1 except yo2 except yo3 except yo4)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "bb": {"name": "bb", "definition": "random(0.7..1.3#0.01 except 1 except aa)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "hsh": {"name": "hsh", "definition": "if(selector='hsh',random(-3..3 except 0),0)", "templateType": "anything", "description": "

horizontal shift

", "group": "Ungrouped variables"}, "yn": {"name": "yn", "definition": "map(vsc*y+vsh,y,yo)", "templateType": "anything", "description": "

new y values after the transformation

", "group": "Ungrouped variables"}, "yo2": {"name": "yo2", "definition": "random(5..12#1 except yo0 except yo1)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "yo1": {"name": "yo1", "definition": "random(5..12#1 except yo0)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "yo3": {"name": "yo3", "definition": "random(5..12#1 except yo0 except yo1 except yo2)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "yo01": {"name": "yo01", "definition": "f+yo0", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "maxvector": {"name": "maxvector", "definition": "vector(yo1, yo2,yo3, yo4, yo5, yo11, yo21,yo31, yo41, yo51)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "vsh": {"name": "vsh", "definition": "if(selector='vsh',random(-3..3#0.5 except 0),0)\n", "templateType": "anything", "description": "

vertical shift

", "group": "Ungrouped variables"}, "eee": {"name": "eee", "definition": "random(1..6#1)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "selector": {"name": "selector", "definition": "'vsc'", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "f": {"name": "f", "definition": "random(1..6#1)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "yo41": {"name": "yo41", "definition": "d+yo4", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "d": {"name": "d", "definition": "random(1..6#1)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "yo11": {"name": "yo11", "definition": "a+yo1", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "b": {"name": "b", "definition": "random(1..6#1)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "maxx": {"name": "maxx", "definition": "max(map(abs(a),a,xn)+5)+1", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "fakeanswer1": {"name": "fakeanswer1", "definition": "precround(aa*answer,2)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "fakeanswer4": {"name": "fakeanswer4", "definition": "precround(dd*answer,2)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "vsc": {"name": "vsc", "definition": "if(selector='vsc',random(-2,-1,-0.5,0.5,2),1)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "hsc": {"name": "hsc", "definition": "if(selector='hsc',random(-2,-1,-0.5,0.5,2),1)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "yo21": {"name": "yo21", "definition": "b+yo2", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "c": {"name": "c", "definition": "random(1..6#1)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "a": {"name": "a", "definition": "random(1..6#1)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "dd": {"name": "dd", "definition": "random(0.7..1.3#0.01 except 1 except aa except bb except cc)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "fakeanswer2": {"name": "fakeanswer2", "definition": "precround(bb*answer,2)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "cc": {"name": "cc", "definition": "random(0.7..1.3#0.01 except 1 except aa except bb)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "maxy": {"name": "maxy", "definition": "max(list(maxvector)) + 1", "templateType": "anything", "description": "", "group": "Ungrouped variables"}}, "type": "question", "contributors": [{"name": "Gareth Woods", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/978/"}]}]}], "contributors": [{"name": "Gareth Woods", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/978/"}]}