// Numbas version: exam_results_page_options {"name": "MSS - Histogram Mode", "extensions": ["stats", "jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "MSS - Histogram Mode", "tags": [], "metadata": {"description": "

Students are shown a bar chart. There is a slider that adjusts the height of one of the bars. Students are asked to adjust the slider to make that particular bar value the mode.

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

Adjust the slider until the mode of the chart below is equal to only $\\var{modetarget_true}$.

", "advice": "

The mode is the most frequently occurring number. You need to adjust the slider until the bar is the biggest one in the chart.

", "rulesets": {}, "extensions": ["jsxgraph", "stats"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"histogram": {"name": "histogram", "group": "Ungrouped variables", "definition": "jessiecode(700, 400, [-0.7, 15, 8, -0.5], \"snapslider={snapslider};othervalues={othervalues};modevalues={modevalues};modetarget={modetarget};barcolours={barcolours};\"+safe(\"\"\"\n xaxis = axis([0,0],[1,0]) <<\n ticks: <> >>,\n name: 'X',\n withLabel: false,\n label: <>\n >>;\n \n slider([1,14],[4,14],[0.5,0,8]) <>;\n \n modevalues2 = [\n function(){return modevalues[0]*histSlider.Value();},\n function(){return modevalues[1]*histSlider.Value();},\n function(){return modevalues[2]*histSlider.Value();},\n function(){return modevalues[3]*histSlider.Value();},\n function(){return modevalues[4]*histSlider.Value();},\n function(){return modevalues[5]*histSlider.Value();},\n function(){return modevalues[6]*histSlider.Value();}\n ];\n \n chart(othervalues) <>;\n \n chart(modevalues2) <>;\n \n \"\"\"),\n[\"axis\": true,\n \"showNavigation\": false,\n \"grid\": false,\n \"showCopyright\": false,\n \"keepaspectratio\": false \n ])", "description": "", "templateType": "anything", "can_override": false}, "snapslider": {"name": "snapslider", "group": "Ungrouped variables", "definition": "0.1", "description": "

This value determines the increment size of the slider in the chart.

", "templateType": "number", "can_override": false}, "chartvalues": {"name": "chartvalues", "group": "Ungrouped variables", "definition": "shuffle(1..7)", "description": "", "templateType": "anything", "can_override": false}, "modetarget_value": {"name": "modetarget_value", "group": "Ungrouped variables", "definition": "random(1 .. 6#1)", "description": "", "templateType": "randrange", "can_override": false}, "barcolours": {"name": "barcolours", "group": "Ungrouped variables", "definition": "repeat('#0492c2',7)", "description": "", "templateType": "anything", "can_override": false}, "modetarget": {"name": "modetarget", "group": "Ungrouped variables", "definition": "indices(chartvalues,modetarget_value)", "description": "", "templateType": "anything", "can_override": false}, "modetarget_true": {"name": "modetarget_true", "group": "Ungrouped variables", "definition": "modetarget[0] + 1", "description": "", "templateType": "anything", "can_override": false}, "othervalues": {"name": "othervalues", "group": "Ungrouped variables", "definition": "[\n if(0=modetarget[0],0,chartvalues[0]),\n if(1=modetarget[0],0,chartvalues[1]),\n if(2=modetarget[0],0,chartvalues[2]),\n if(3=modetarget[0],0,chartvalues[3]),\n if(4=modetarget[0],0,chartvalues[4]),\n if(5=modetarget[0],0,chartvalues[5]),\n if(6=modetarget[0],0,chartvalues[6])\n ]", "description": "", "templateType": "anything", "can_override": true}, "modevalues": {"name": "modevalues", "group": "Ungrouped variables", "definition": "[\n if(0=modetarget[0],chartvalues[0],0),\n if(1=modetarget[0],chartvalues[1],0),\n if(2=modetarget[0],chartvalues[2],0),\n if(3=modetarget[0],chartvalues[3],0),\n if(4=modetarget[0],chartvalues[4],0),\n if(5=modetarget[0],chartvalues[5],0),\n if(6=modetarget[0],chartvalues[6],0)\n ]", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["histogram", "snapslider", "chartvalues", "modetarget_value", "barcolours", "modetarget", "modetarget_true", "othervalues", "modevalues"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "extension", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "pos:\n jxg_value(histogram[\"histSlider\"])\n\nstudentZScore:\n withintolerance(pos,question_zscore,snapslider/2)\n\nstudent_feedback:\n feedback(\"The mode is the most frequently occurring number. You need to adjust the slider until the bar\" \n + \" is the biggest one in the chart\")\n\nmark:\n correctif(7 < pos*modetarget_value);\n apply(student_feedback)\n\ninterpreted_answer:\n pos", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

{histogram}

"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Merryn Horrocks", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4052/"}, {"name": "Brent Le Cornu", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/18260/"}]}]}], "contributors": [{"name": "Merryn Horrocks", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4052/"}, {"name": "Brent Le Cornu", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/18260/"}]}