// Numbas version: exam_results_page_options {"name": "Shifted 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": [{"advice": "", "parts": [{"prompt": "
\n

Fourier Series

\n

What was the percentage of rejects in February?

", "scripts": {}, "displayType": "radiogroup", "variableReplacements": [], "shuffleChoices": true, "showFeedbackIcon": true, "distractors": ["", "", "", "", ""], "displayColumns": 0, "choices": ["

        

", "", "

      

", "", "

        

"], "matrix": ["1", 0, 0, 0, 0], "variableReplacementStrategy": "originalfirst", "marks": 0, "type": "1_n_2", "showCorrectAnswer": true, "maxMarks": 0, "minMarks": 0}], "extensions": ["jsxgraph"], "ungrouped_variables": ["t", "c", "shift"], "rulesets": {"std": ["all", "fractionNumbers"]}, "variables": {"shift": {"group": "Ungrouped variables", "name": "shift", "description": "", "templateType": "anything", "definition": "random(-t/2..t/2 except 0)"}, "t": {"group": "Ungrouped variables", "name": "t", "description": "", "templateType": "anything", "definition": "random(2..20#2)"}, "c": {"group": "Ungrouped variables", "name": "c", "description": "", "templateType": "anything", "definition": "random(4..12#1 except t)"}}, "functions": {}, "statement": "

Calculate the Fourier Series of the function sketched below.

", "name": "Shifted Top Hat Function Fourier Series", "metadata": {"licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International", "description": "

Widget Sales

"}, "variablesTest": {"maxRuns": 100, "condition": ""}, "variable_groups": [], "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 + shift,y1=0], [x2=-t/2 + shift,y2=0]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n var parabool2 = board.create('line',[[x1=-t/2 + shift,y1=0], [x2=-t/2 + shift,y2=c]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n \n var parabool3 = board.create('line',[[x1=-t/2 + shift,y1=c], [x2=t/2 + shift,y2=c]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n var parabool4 = board.create('line',[[x1=t/2 + shift,y1=c], [x2=t/2 + shift,y2=0]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n \n var parabool5 = board.create('line',[[x1=t/2 + shift,y1=0], [x2=t + shift,y2=0]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n \n var parabool6 = board.create('line',[[x1=-t + shift,y1=0], [x2=-1.5*t + shift,y2=0]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n var parabool6 = board.create('line',[[x1=t + shift,y1=0], [x2=1.5*t + shift,y2=0]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n \n var parabool7 = board.create('line',[[x1=-1.5*t + shift,y1=0], [x2=-1.5*t + shift,y2=c]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n var parabool8 = board.create('line',[[x1=-1.5*t + shift,y1=c], [x2=-2.5*t + shift,y2=c]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n \n var parabool9 = board.create('line',[[x1=1.5*t + shift,y1=0], [x2=1.5*t + shift,y2=c]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n var parabool10 = board.create('line',[[x1=1.5*t + shift,y1=c], [x2=2.5*t + shift,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}"}, "tags": [], "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/"}]}