// Numbas version: exam_results_page_options {"name": "Top Hat Function Fourier Series", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"rulesets": {"std": ["all", "fractionNumbers"]}, "statement": "

Calculate the Fourier Series of the function sketched below.

", "metadata": {"description": "

Widget Sales

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "functions": {}, "name": "Top Hat Function Fourier Series", "parts": [{"answer": "", "checkingaccuracy": 0.001, "showpreview": true, "vsetrangepoints": 5, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "showFeedbackIcon": true, "vsetrange": [0, 1], "marks": 1, "type": "jme", "expectedvariablenames": [], "checkingtype": "absdiff", "variableReplacements": [], "scripts": {}, "checkvariablenames": false}], "variable_groups": [], "variablesTest": {"condition": "", "maxRuns": 100}, "variables": {"t": {"definition": "random(2..20#2)", "description": "", "templateType": "anything", "name": "t", "group": "Ungrouped variables"}, "shift": {"definition": "random(-t/2..t/2 except 0)", "description": "", "templateType": "anything", "name": "shift", "group": "Ungrouped variables"}, "c": {"definition": "random(4..12#1 except t)", "description": "", "templateType": "anything", "name": "c", "group": "Ungrouped variables"}}, "ungrouped_variables": ["t", "c", "shift"], "tags": [], "extensions": ["jsxgraph"], "preamble": {"js": "function dragpoint_board() {\n var scope = question.scope;\n\n JXG.Options.text.display = 'internal';\n \n var t = scope.variables.t.value;\n var c = scope.variables.c.value;\n var shift = scope.variables.shift.value;\n \n var div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',{boundingBox:[-2*t,14,2*t,-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=-t,y1=0], [x2=-t/2,y2=0]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n var parabool2 = board.create('line',[[x1=-t/2,y1=0], [x2=-t/2,y2=c]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n \n var parabool3 = board.create('line',[[x1=-t/2,y1=c], [x2=t/2,y2=c]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n var parabool4 = board.create('line',[[x1=t/2,y1=c], [x2=t/2,y2=0]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n \n var parabool5 = board.create('line',[[x1=t/2,y1=0], [x2=t,y2=0]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n \n var parabool6 = board.create('line',[[x1=-t,y1=0], [x2=-1.5*t,y2=0]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n var parabool6 = board.create('line',[[x1=t,y1=0], [x2=1.5*t,y2=0]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n \n var parabool7 = board.create('line',[[x1=-1.5*t,y1=0], [x2=-1.5*t,y2=c]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n var parabool8 = board.create('line',[[x1=-1.5*t,y1=c], [x2=-2.5*t,y2=c]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n \n var parabool9 = board.create('line',[[x1=1.5*t,y1=0], [x2=1.5*t,y2=c]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n var parabool10 = board.create('line',[[x1=1.5*t,y1=c], [x2=2.5*t,y2=c]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n \n// var parabool9 = board.create('line',[[x1=-t+ shift,y1=c], [x2=-1.5*t+ shift,y2=0]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n// var parabool10 = board.create('line',[[x1=t+ shift,y1=c], [x2=1.5*t+ shift,y2=0]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n}\n\nquestion.signals.on('HTMLAttached',function() {\n dragpoint_board();\n});", "css": "table#values th {\n background: none;\n text-align: center;\n}"}, "advice": "", "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/"}]}