// Numbas version: finer_feedback_settings {"question_groups": [{"pickingStrategy": "all-ordered", "name": "", "pickQuestions": 1, "questions": [{"name": "Christmas Multiple Choice", "extensions": [], "custom_part_types": [], "resources": [["question-resources/ivy.jpg", "/srv/numbas/media/question-resources/ivy.jpg"], ["question-resources/holly.jpg", "/srv/numbas/media/question-resources/holly.jpg"], ["question-resources/mistletoe.jpg", "/srv/numbas/media/question-resources/mistletoe.jpg"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}], "ungrouped_variables": [], "parts": [{"type": "1_n_2", "displayType": "radiogroup", "showCorrectAnswer": true, "minMarks": 0, "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "marks": 0, "displayColumns": 0, "shuffleChoices": false, "prompt": "

What are the characteristics of Frosty the Snowman, as described in the famous Christmas song?

", "maxMarks": 0, "matrix": [0, "0.5", "0", "0"], "scripts": {}, "variableReplacements": [], "choices": ["

An awfully grumpy chap

", "

 A jolly happy soul

", "

A really cheery guy

", "

A very melty gent

"], "distractors": ["With all that laughing and playing?!?", "", "Close...", "He waved goodbye before he melted and went thumpity thumping across the hills of snow"]}, {"type": "m_n_2", "displayType": "checkbox", "warningType": "none", "showCorrectAnswer": true, "minAnswers": 0, "minMarks": 0, "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "marks": 0, "displayColumns": "3", "shuffleChoices": false, "maxAnswers": 0, "prompt": "

Which of the following are genuine reindeer names, according to Clement Clarke Moore's famous poem \"A Visit from St. Nicholas\" (AKA \"The Night Before Christmas\")

", "maxMarks": "2.5", "matrix": ["0.5", "-0.5", "-0.5", "0.5", "-0.5", "0.5", "-0.5", "0.5", "0.5"], "scripts": {}, "variableReplacements": [], "choices": ["

Donna

", "

Rudolph

", "

Brenda

", "

Cupid

", "

Stupid

", "

Comet

", "

Crumpet

", "

Blitzen 

", "

Dancer

"], "distractors": ["", "Actually, Rudolph wasn't in the original poem.", "", "", "", "", "", "", ""]}, {"answers": ["

Ivy

", "

Holly

", "

Mistletoe

"], "type": "m_n_x", "displayType": "radiogroup", "warningType": "none", "layout": {"expression": "", "type": "all"}, "showCorrectAnswer": true, "minAnswers": 0, "minMarks": 0, "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "marks": 0, "shuffleAnswers": true, "shuffleChoices": true, "maxAnswers": 0, "prompt": "

Match up each piece of festive greenery with its name.

", "maxMarks": 0, "matrix": [["0.5", 0, 0], [0, "0.5", 0], [0, 0, "0.5"]], "scripts": {}, "variableReplacements": [], "choices": ["

", "

", "

"]}, {"answers": ["

Dutch

", "

French

", "

German

", "

Korean

", "

Norwegian

"], "type": "m_n_x", "displayType": "radiogroup", "warningType": "none", "layout": {"expression": "", "type": "all"}, "showCorrectAnswer": true, "minAnswers": 0, "minMarks": 0, "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "marks": 0, "shuffleAnswers": true, "shuffleChoices": true, "maxAnswers": 0, "prompt": "

Match the following translations of the greeting \"Merry Christmas\" with the correct language.

", "maxMarks": 0, "matrix": [["0", "0", "0.5", 0, "0"], ["0", 0, 0, "0", "0.5"], ["0", 0, "0", "0.5", 0], [0, "0.5", "0", 0, 0], ["0.5", 0, 0, 0, 0]], "scripts": {}, "variableReplacements": [], "choices": ["

Frohe Weihnachten

", "

Gledelig Jul

", "

Meri krismas

", "

Joyeux Noël

", "

Zalig Kerstmis

"]}], "preamble": {"css": "", "js": ""}, "variables": {}, "tags": [], "advice": "

a)

\n

The song Frosty the Snowman goes like this:

\n
\n

\"Frosty the Snowman
Was a jolly happy soul
With a corncob pipe and a button nose
And two eyes made out of coal
Frosty the Snowman\"

\n

\n
\n

b)

\n

An extract from Clement Clarke Moore's \"A Visit from St. Nicholas\":

\n
\n
\"Twas the night before Christmas, when all through the house
\n
Not a creature was stirring, not even a mouse;
\n
The stockings were hung by the chimney with care,
\n
In hopes that St. Nicholas soon would be there;
...
\n
I knew in a moment he must be St. Nick.
\n
More rapid than eagles his coursers they came,
\n
And he whistled, and shouted, and called them by name:
\n
\"Now, Dasher! now, Dancer! now Prancer and Vixen!
\n
On, Comet! on, Cupid! on, Donner and Blitzen!
\n
To the top of the porch! to the top of the wall!\"
\n
\n
\n

c)

\n

Holly has the red berries, mistletoe the white. Don't forget or you could be hanging around, puckered up under the Holly for a while...

\n

d)

\n

\nA list of \"Merry Christmas\" greetings can be found in many places online, to impress your family on the big day.  Danistayohihv &Aliheli'sdi Itse Udetiyvasadisv and have a Happy New Year!
", "functions": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "variable_groups": [], "rulesets": {}, "statement": "

Numbas has comprehensive support for multiple choice questions. The order of choices can be randomised, the marking matrix can be calculated from question variables, and you can write specific feedback for each choice.

\n
\n

Answer the following festive multiple-choice questions:

\n

", "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": ""}, "type": "question"}, {"name": "Christmas Anagrams", "extensions": [], "custom_part_types": [], "resources": [["question-resources/words.png", "/srv/numbas/media/question-resources/words.png"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}], "tags": [], "ungrouped_variables": [], "metadata": {"licence": "None specified", "description": ""}, "advice": "

You can't do it? That's just out of order! 

", "rulesets": {}, "variablesTest": {"maxRuns": 100, "condition": ""}, "parts": [{"stepsPenalty": "0.5", "scripts": {}, "showFeedbackIcon": true, "type": "gapfill", "gaps": [{"displayAnswer": "Mistletoe", "scripts": {}, "answer": "Mistletoe", "showFeedbackIcon": true, "type": "patternmatch", "matchMode": "exact", "marks": 1, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": []}], "prompt": "

Most elite   [[0]]

\n

", "marks": 0, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "steps": [{"scripts": {}, "showFeedbackIcon": true, "type": "information", "prompt": "

Romantic Christmas greenery.

", "marks": 0, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": []}], "variableReplacements": []}, {"stepsPenalty": "0.5", "scripts": {}, "showFeedbackIcon": true, "type": "gapfill", "gaps": [{"displayAnswer": "Christmas cake", "scripts": {}, "answer": "Christmas cake", "showFeedbackIcon": true, "type": "patternmatch", "matchMode": "exact", "marks": 1, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": []}], "prompt": "

Thick massacre  [[0]]

\n

", "marks": 0, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "steps": [{"scripts": {}, "showFeedbackIcon": true, "type": "information", "prompt": "

Hopefully, if you make one for pudding, it will not be described as such.

", "marks": 0, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": []}], "variableReplacements": []}, {"stepsPenalty": "0.5", "scripts": {}, "showFeedbackIcon": true, "type": "gapfill", "gaps": [{"displayAnswer": "Frosty the snowman", "scripts": {}, "answer": "Frosty the snowman", "showFeedbackIcon": true, "type": "patternmatch", "matchMode": "exact", "marks": 1, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": []}], "prompt": "

Honesty warms font  [[0]]

\n

", "marks": 0, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "steps": [{"scripts": {}, "showFeedbackIcon": true, "type": "information", "prompt": "

He could laugh and play, just the same as you and me.

", "marks": 0, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": []}], "variableReplacements": []}, {"stepsPenalty": "0.5", "scripts": {}, "showFeedbackIcon": true, "type": "gapfill", "gaps": [{"displayAnswer": "Father Christmas", "scripts": {}, "answer": "Father Christmas", "showFeedbackIcon": true, "type": "patternmatch", "matchMode": "exact", "marks": 1, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": []}], "prompt": "

The rich Mr Fat Ass  [[0]]

\n

", "marks": 0, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "steps": [{"scripts": {}, "showFeedbackIcon": true, "type": "information", "prompt": "

Creepy man who sneaks around at night.

", "marks": 0, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": []}], "variableReplacements": []}], "variable_groups": [], "variables": {}, "functions": {}, "statement": "

\n

Unscramble each of the following anagrams into a common festive word or phrase.

\n

", "preamble": {"css": "", "js": "question.signals.on('HTMLAttached',function() {\n\n // Change the step buttons to hints\n $(\".btn\").text(function () {\n return $(this).text().replace(\"steps\", \"hint\"); \n });\n \n});"}, "type": "question"}, {"name": "Santa's big round tummy", "extensions": [], "custom_part_types": [], "resources": [["question-resources/santastuck_BCAneMV.svg", "/srv/numbas/media/question-resources/santastuck_BCAneMV.svg"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}], "variable_groups": [], "preamble": {"css": "", "js": ""}, "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "

Numbas has many options for numeric input, including restrictions on precision and options to allow, for example, input as a fraction. You might need a calculator for this one!

\n
\n

The chimney at 52 Festive Road has internal dimensions of {b} x {a} cm. Santa has arrived with presents on Christmas morning.

\n

", "parts": [{"scripts": {}, "showFeedbackIcon": true, "showCorrectAnswer": true, "steps": [{"scripts": {}, "showFeedbackIcon": true, "showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "type": "information", "variableReplacementStrategy": "originalfirst", "prompt": "

The circumference of a circle is given by $\\pi d$, where $d$ is the diameter. Now think about the maximum diameter for a circle that would fit inside the rectangle at the top of the chimney.

"}], "stepsPenalty": 0, "variableReplacements": [], "marks": 0, "gaps": [{"maxValue": "pi*{a}", "precision": "1", "showFeedbackIcon": true, "showCorrectAnswer": true, "correctAnswerStyle": "plain", "precisionPartialCredit": 0, "showPrecisionHint": false, "allowFractions": false, "minValue": "pi*{a}", "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "type": "numberentry", "precisionType": "dp", "strictPrecision": false, "scripts": {}, "correctAnswerFraction": false, "precisionMessage": "

You have not given your answer to the correct precision.

", "marks": "2"}], "type": "gapfill", "variableReplacementStrategy": "originalfirst", "prompt": "

Assuming that Santa has a big, perfectly circular tummy, what is its maximum circumference, in order to fit down the chimney?

\n

[[0]] cm          Round your answer to 1 decimal places.

"}], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": ""}, "variables": {"a": {"name": "a", "group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "random(40..50#10)"}, "b": {"name": "b", "group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "a+random(5..15#5)"}}, "functions": {}, "advice": "

The circumference of a circle is given by $\\pi d$, where $d$ is the diameter. 

\n

The trick here is to realise that the maxmum diameter corresponds to the shortest length of the rectangular chimney, {a}cm.

\n

Therefore the maximum circumference of his tummy is $\\pi\\times\\var{a} = \\var{precround(pi*a,1)}$cm. 

\n

According the National Obesity Forum, he is at substantially increased risk of conditions such as coronary heart disease.

", "rulesets": {}, "ungrouped_variables": ["a", "b"], "tags": [], "type": "question"}, {"name": "Santa's elves equation of a straight line", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": ""}, "parts": [{"type": "gapfill", "variableReplacements": [], "gaps": [{"allowFractions": false, "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "showFeedbackIcon": true, "marks": 1, "maxValue": "11*m+c", "minValue": "11*m+c", "notationStyles": ["plain", "en", "si-en"], "mustBeReduced": false, "correctAnswerStyle": "plain", "variableReplacements": [], "showCorrectAnswer": true, "scripts": {}, "correctAnswerFraction": false, "type": "numberentry"}], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "showFeedbackIcon": true, "marks": 0, "prompt": "

There are roughly 11 million children in the UK. How many elves does Santa need?

\n

[[0]] elves

", "scripts": {}}, {"steps": [{"type": "information", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "showFeedbackIcon": true, "marks": 0, "prompt": "

The equation of a straight line is traditionally written

\n

\\[ y = mx+c\\text{,}\\]

\n

where $m$ is the gradient of the line, and $c$ the intercept with the y axis.

\n

In our case, the variables are labelled $E$ and $n$ (rather than $y$ and $x$ respectively). The intercept $c$ is the number of elves required for $0$ children, i.e. the base number, $\\var{c}$. And the gradient $m$ is the number of elves required for each unit $n$, which is given as $\\var{m}$.

\n

", "scripts": {}}], "type": "gapfill", "variableReplacements": [], "gaps": [{"checkingaccuracy": 0.001, "type": "jme", "vsetrange": [0, 1], "checkingtype": "absdiff", "scripts": {}, "showFeedbackIcon": true, "answer": "{m}*n+{c}", "marks": "2", "checkvariablenames": true, "vsetrangepoints": 5, "variableReplacements": [], "expectedvariablenames": ["n"], "showCorrectAnswer": true, "showpreview": true, "variableReplacementStrategy": "originalfirst"}], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "stepsPenalty": 0, "showFeedbackIcon": true, "marks": 0, "prompt": "

Santa makes a plot of the number of elves he requires, $E$, against the number of children, $n$ (in units of million children):

\n

{graphsolution()}

\n

What is the equation of the line?

\n

$E(n)=$ [[0]]

", "scripts": {}}], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"c": {"definition": "random(30..60#10)", "templateType": "anything", "name": "c", "group": "Ungrouped variables", "description": ""}, "m": {"definition": "random(15..30#5)", "templateType": "anything", "name": "m", "group": "Ungrouped variables", "description": ""}}, "ungrouped_variables": ["c", "m"], "preamble": {"css": "", "js": ""}, "advice": "

a)

\n

The number of elves Santa requires is

\n

\\[ ({m}\\times 11) + {c} \\text{.}\\]  

\n

b)

\n

The equation of a straight line is traditionally written

\n

\\[ y = mx+c\\text{,}\\]

\n

where $m$ is the gradient of the line, and $c$ the intercept with the y axis.

\n

In our case, the variables are labelled $E$ and $n$ (rather than $y$ and $x$ respectively). The intercept $c$ is the number of elves required for $0$ children, i.e. the base number, $\\var{c}$. And the gradient $m$ is the number of elves required for each unit $n$, which is given as $\\var{m}$.

\n

Therefore the equation of Santa's line is

\n

\\[ E(n) = \\var{m}x + \\var{c}\\text{.}\\]

\n

To learn more about the equation of a straight line, here is Professor Robin Johnson solving a slightly trickier problem:

\n

", "statement": "

Note that this question is randomised, including the graph (try clicking \"Try another question like this one\"), and that you get a preview of the answer when you type in an expression. One more thing: the correct answer is written in terms of the variable n, go on try a different letter, like x, it separates the validation from the marking to help you out.

\n
\n

Santa is reviewing the personnel requirements for the North Pole's UK division. He requires {c} elves to do the basic administrative jobs, plus {m} elves for every 1 million children, to manage toy making and the like.

\n

", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "functions": {"graphsolution": {"definition": "JXG.Options.layer['curve'] = 9;\nJXG.Options.layer['line'] = 7;\n\nvar c = Numbas.jme.unwrapValue(scope.variables.c);\nvar m = Numbas.jme.unwrapValue(scope.variables.m);\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',\n {boundingBox:[-0.7,12*m+c,13,-45],\n axis:false,\n showNavigation:false,\n grid:false});\nvar brd = div.board; \nxaxis = brd.create('axis', [[0, 0], [1,0]], \n\t\t {name:'$$n$$', \n strokeColor: 'black',\n fixed: true,\n withLabel: true,\n label: {position: 'rt', offset: [0, -15], fontSize: 17}\n\t\t\t});\nyaxis = brd.create('axis', [[0, 0], [0, 1]], \n\t\t {name:'$$E$$', \n strokeColor: 'black',\n fixed: true,\n\t\t withLabel: true,\n label: {position: 'rt', offset: [-20, 0], fontSize: 17}\n\t\t\t});\t\n\nvar q=brd.create('line',[[0,c],[10,c+(m*10)]],{fixed:true,strokeColor:'blue',strokeWidth:2,straightFirst:false});\nvar tree;\n//n is the variable in the equation to be input\n var nscope = new Numbas.jme.Scope([scope,{variables:{n:new Numbas.jme.types.TNum(0)}}]);\n//create a functiongraph from the student input\nfunction userf(n){\nif(tree) {\n try {\nnscope.variables.n.value = n;\n var val = Numbas.jme.evaluate(tree,nscope).value;\n return val;\n }\n catch(e) {\nreturn 0;\n }\n}\nelse\n return -100;\n}\nvar curve=brd.create('functiongraph',[userf,0,12],{strokeColor:'red',strokeWidth:2,dash:2});\n\n //pick up the student answer and is parsed\n question.signals.on('HTMLAttached',function(e) {\nko.computed(function(){\nvar expr = question.parts[1].gaps[0].display.studentAnswer();\ntry {\n tree = Numbas.jme.compile(expr,scope);\n}\ncatch(e) {\n tree = null;\n}\ncurve.updateCurve();\n\nbrd.update();\n});\n }); \n\nreturn div;\n ", "language": "javascript", "type": "html", "parameters": []}}, "tags": [], "variable_groups": [], "type": "question"}, {"name": "Christmas cracker guess my number game", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "metadata": {"licence": "None specified", "description": ""}, "rulesets": {}, "functions": {"show_card": {"definition": "var table = document.createElement('table');\ntable.classList.add('cracker-card');\nif(selected) {\n table.classList.add('selected');\n}\ntable.setAttribute('data-digit',ns[ns.length-1]);\nvar size = Math.sqrt(ns.length);\nfor(var y=0;yAt Christmas dinner, your pal's cracker contains an Amazing Magic Trick.

\n

Your pal asks you to pick a whole number between 1 and 30, then shows you the following five cards and asks which cards contain your number.

\n

{show_card(cards[0],false)} {show_card(cards[1],false)} {show_card(cards[2],false)} {show_card(cards[3],false)} {show_card(cards[4],false)}

\n

Amazingly, your pal is able to magically divine the number you're thinking of every time!

", "variable_groups": [], "preamble": {"css": ".cracker-cards {\n text-align: center;\n}\n.cracker-card {\n border: 1px solid;\n display: inline-block;\n margin: 1em;\n font-size: 0.8em;\n}\n.cracker-card td {\n width: 2em;\n height: 2em;\n text-align: center;\n}\n\n.choice:checked + span .cracker-card td, .cracker-card.selected td {\n background: yellow !important;\n}", "js": ""}, "ungrouped_variables": ["cards", "b_number"], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"b_number": {"definition": "random(1..30)", "name": "b_number", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "cards": {"definition": "cards(2)", "name": "cards", "group": "Ungrouped variables", "templateType": "anything", "description": ""}}, "tags": [], "advice": "", "parts": [{"distractors": ["", "", "", "", ""], "minAnswers": 0, "maxAnswers": 0, "showCorrectAnswer": false, "minMarks": 0, "variableReplacements": [], "type": "m_n_2", "maxMarks": 0, "prompt": "

To get an idea of how the trick works, try picking a number between 1 and 30 and clicking all the cards containing that number. When you submit this part, we'll guess which number you were thinking of. It's important that you make sure you check every card containing your number.

\n

You can try this as many times as you like.

", "shuffleChoices": false, "matrix": [0, 0, 0, 0, 0], "variableReplacementStrategy": "originalfirst", "warningType": "none", "displayType": "checkbox", "choices": ["

{show_card(cards[0],false)}

", "

{show_card(cards[1],false)}

", "

{show_card(cards[2],false)}

", "

{show_card(cards[3],false)}

", "

{show_card(cards[4],false)}

"], "marks": 0, "scripts": {"mark": {"script": "var n = 0;\nthis.ticks.forEach(function(t,i){if(t[0]) { n += Math.pow(2,i) }});\nconsole.log(n);\nthis.setCredit(1);\nthis.markingComment(\"Is your number \"+n+\"?\");\nthis.display.feedbackShown(true);", "order": "instead"}, "validate": {"script": "return true;", "order": "instead"}}, "displayColumns": 0, "showFeedbackIcon": false}, {"mustBeReducedPC": 0, "scripts": {}, "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "allowFractions": false, "type": "numberentry", "prompt": "

When you think you've worked out how the trick works, your pal offers to let you try it on them.

\n

Your pal has thought of a number, and says it's on the cards highlighted below:

\n

{show_card(cards[0],b_number and 1)} {show_card(cards[1],b_number and 2)} {show_card(cards[2],b_number and 4)} {show_card(cards[3],b_number and 8)} {show_card(cards[4],b_number and 16)}

\n

You can work it out by looking very carefully at all the cards, but there's a quicker way!

", "correctAnswerFraction": false, "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "mustBeReduced": false, "marks": 1, "minValue": "b_number", "maxValue": "b_number", "showFeedbackIcon": true}], "type": "question"}, {"name": "Santa Rally CSV example", "extensions": ["stats"], "custom_part_types": [], "resources": [["question-resources/christmas-money-2947946_1280_b6KFy88.png", "/srv/numbas/media/question-resources/christmas-money-2947946_1280_b6KFy88.png"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}], "preamble": {"css": "", "js": ""}, "variables": {"ftse": {"templateType": "json", "description": "

FTSE 100 data for the last 8 Decembers.

", "group": "Ungrouped variables", "definition": "json_decode(safe(\"[\\n {\\n \\\"year\\\": \\\"2009\\\",\\n \\\"month\\\": \\\"December 2009\\\",\\n \\\"open\\\": 5191,\\n \\\"close\\\": 5413,\\n \\\"high\\\": 5445,\\n \\\"low\\\": 5175\\n },\\n {\\n \\\"year\\\": \\\"2010\\\",\\n \\\"month\\\": \\\"December 2010\\\",\\n \\\"open\\\": 5528,\\n \\\"close\\\": 5899,\\n \\\"high\\\": 6021,\\n \\\"low\\\": 5528\\n },\\n {\\n \\\"year\\\": \\\"2011\\\",\\n \\\"month\\\": \\\"December 2011\\\",\\n \\\"open\\\": 5505,\\n \\\"close\\\": 5588,\\n \\\"high\\\": 5631,\\n \\\"low\\\": 5328\\n },\\n {\\n \\\"year\\\": \\\"2012\\\",\\n \\\"month\\\": \\\"December 2012\\\",\\n \\\"open\\\": 5867,\\n \\\"close\\\": 5897,\\n \\\"high\\\": 5997,\\n \\\"low\\\": 5852\\n },\\n {\\n \\\"year\\\": \\\"2013\\\", \\n \\\"month\\\": \\\"December 2013\\\",\\n \\\"open\\\": 6651,\\n \\\"close\\\": 6749,\\n \\\"high\\\": 6768,\\n \\\"low\\\": 6422\\n },\\n {\\n \\\"year\\\": \\\"2014\\\", \\n \\\"month\\\": \\\"December 2014\\\",\\n \\\"open\\\": 6722,\\n \\\"close\\\": 6566,\\n \\\"high\\\": 6753,\\n \\\"low\\\": 6144\\n },\\n {\\n \\\"year\\\": \\\"2015\\\",\\n \\\"month\\\": \\\"December 2015\\\",\\n \\\"open\\\": 6356,\\n \\\"close\\\": 6242,\\n \\\"high\\\": 6356,\\n \\\"low\\\": 5871\\n },\\n {\\n \\\"year\\\": \\\"2016\\\", \\n \\\"month\\\": \\\"December 2016\\\",\\n \\\"open\\\": 6783,\\n \\\"close\\\": 7120,\\n \\\"high\\\": 7143,\\n \\\"low\\\": 6678\\n }\\n]\"))", "name": "ftse"}, "mean_rise": {"templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "100*mean(map((row[\"close\"]-row[\"open\"])/row['open'],row,ftse_given))", "name": "mean_rise"}, "rows": {"templateType": "anything", "description": "

The number of years worth of data to provide

", "group": "Ungrouped variables", "definition": "random(5..8)", "name": "rows"}, "max_diff_years": {"templateType": "anything", "description": "

Vector of logicals, if this year is the one is the max volatile

", "group": "Ungrouped variables", "definition": "map(if((row[\"high\"]-row[\"low\"])=max_diff,1,0),row,ftse_given)", "name": "max_diff_years"}, "ftse_given": {"templateType": "anything", "description": "

Subset of ftse to give to the student

", "group": "Ungrouped variables", "definition": "ftse[(length(ftse)-rows)..length(ftse)]", "name": "ftse_given"}, "years": {"templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "map(item[\"year\"],item,ftse_given)", "name": "years"}, "max_diff": {"templateType": "anything", "description": "

the max difference between high and low (most volatile year)

", "group": "Ungrouped variables", "definition": "max(map(row[\"high\"]-row[\"low\"],row,ftse_given))", "name": "max_diff"}}, "metadata": {"description": "", "licence": "None specified"}, "rulesets": {}, "statement": "
\n

This is one for SPSS users (or in Excel, R, or similar; the data is small and just for demonstration purposes). The question provides a CSV file containing data. The clever bit is that the data file is randomised by Numbas (in this case the number of years of data, but could easily have been the values themselves).

\n
\n

The so called 'Santa Rally' is the pattern of positive rises in the financial markets in the month of December. There are many suggestions for the cause, including the mood of traders and the tax benefits, which cause a surge of investments before the end of the calendar year.

\n

Download this {download_csv(ftse_given,rows)}, which contains data from the last {rows} Decembers, up to 2016, and open it in your favourite program.

\n

", "ungrouped_variables": ["ftse", "rows", "years", "ftse_given", "mean_rise", "max_diff", "max_diff_years"], "functions": {"download_csv": {"type": "html", "parameters": [["ftse", "list"], ["years", "number"]], "definition": "// Gather data\nvar data = [['Month','Open','Close','High','Low']]; \n\nconsole.log(ftse.length-years)\n\nfor(var j=(ftse.length-years);ja) \n

Firstly, create a new column of data containing the percentage change, given by:

\n

\\[  \\frac{\\text{(closing value) - (opening value)}}{\\text{(opening value)}}\\times  \\text{100%.}\\]

\n

The following video explains how to compute the mean of a column in SPSS. (Video from BrunelASK)

\n

\n

b) 

\n

To find the most volatile month, create a new column of data:

\n

\\[  \\text{(high value) - (low value),} \\]

\n

to find the maximum value and corresponding year.

", "variablesTest": {"maxRuns": 100, "condition": ""}, "tags": [], "parts": [{"type": "gapfill", "steps": [{"type": "information", "prompt": "

The percentage change for a given month is:

\n

\\[  \\frac{\\text{(closing value) - (opening value)}}{\\text{(opening value)}}\\times  \\text{100%.}\\]

", "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "marks": 0, "scripts": {}, "showCorrectAnswer": true, "variableReplacements": []}], "prompt": "

Calculate the percentage change in the FTSE 100 index for each of the given months to find the average change:

\n

The average change was [[0]]%           Round your answer to 2 decimal places.

", "showFeedbackIcon": true, "gaps": [{"correctAnswerStyle": "plain", "marks": "1", "minValue": "mean_rise", "precisionPartialCredit": 0, "scripts": {}, "mustBeReducedPC": 0, "mustBeReduced": false, "correctAnswerFraction": false, "strictPrecision": false, "allowFractions": false, "type": "numberentry", "precision": "2", "notationStyles": ["plain", "en", "si-en"], "precisionMessage": "You have not given your answer to the correct precision.", "showPrecisionHint": false, "showFeedbackIcon": true, "precisionType": "dp", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showCorrectAnswer": true, "maxValue": "mean_rise"}], "variableReplacementStrategy": "originalfirst", "marks": 0, "stepsPenalty": 0, "scripts": {}, "showCorrectAnswer": true, "variableReplacements": []}, {"type": "gapfill", "prompt": "

Which year was most volatile (had the maximum difference between the high and low value)?

\n

The most volatile year was [[0]] with a difference of [[1]].

", "showFeedbackIcon": true, "gaps": [{"maxMarks": 0, "displayColumns": 0, "showFeedbackIcon": true, "choices": "years", "displayType": "dropdownlist", "scripts": {}, "variableReplacementStrategy": "originalfirst", "type": "1_n_2", "matrix": "max_diff_years", "shuffleChoices": false, "minMarks": 0, "marks": 0, "variableReplacements": [], "showCorrectAnswer": true}, {"marks": 1, "minValue": "max_diff", "scripts": {}, "mustBeReducedPC": 0, "mustBeReduced": false, "correctAnswerFraction": false, "allowFractions": false, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showFeedbackIcon": true, "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showCorrectAnswer": true, "maxValue": "max_diff"}], "variableReplacementStrategy": "originalfirst", "marks": 0, "scripts": {}, "showCorrectAnswer": true, "variableReplacements": []}], "type": "question"}]}], "navigation": {"showresultspage": "oncompletion", "preventleave": true, "onleave": {"message": "", "action": "none"}, "allowregen": true, "browse": true, "showfrontpage": true, "reverse": true}, "name": "NUTELA Christmas Demo", "metadata": {"description": "

Numbas demo questions for NUTELA meeting, December 2017.

", "licence": "Creative Commons Attribution 4.0 International"}, "percentPass": 0, "showstudentname": true, "duration": 0, "timing": {"timeout": {"message": "", "action": "none"}, "timedwarning": {"message": "", "action": "none"}, "allowPause": true}, "feedback": {"intro": "

This short quiz offers a festive introduction to the e-assessment system Numbas, which is developed by the E-Learning Unit in the School of Mathematics, Statistics & Physics.

\n

The quiz is not all maths, and there are plenty of hints to help you out along the way!

\n

This test is in what we would refer to as a 'practice mode'; you can change your answers even after submitting and refresh questions as many times as you like. These settings are ideal for formative material. There are, of course, settings to hide answers, marking and advice until the end of the test, which we use for assessed work.

\n

Enjoy!

\n
\n

All question images from Pixabay

", "showanswerstate": true, "feedbackmessages": [{"message": "

Thank you for taking part - you totally Christmas crackered it!

", "threshold": "50"}, {"message": "

Thank you for taking part - you need to swot up on your Christmas trivia before the big day though!

", "threshold": "0"}], "allowrevealanswer": true, "advicethreshold": 0, "showactualmark": true, "showtotalmark": true, "enterreviewmodeimmediately": true, "showexpectedanswerswhen": "inreview", "showpartfeedbackmessageswhen": "always", "showactualmarkwhen": "always", "showtotalmarkwhen": "always", "showanswerstatewhen": "always", "showadvicewhen": "never"}, "showQuestionGroupNames": false, "type": "exam", "contributors": [{"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}], "extensions": ["jsxgraph", "stats"], "custom_part_types": [], "resources": [["question-resources/ivy.jpg", "/srv/numbas/media/question-resources/ivy.jpg"], ["question-resources/holly.jpg", "/srv/numbas/media/question-resources/holly.jpg"], ["question-resources/mistletoe.jpg", "/srv/numbas/media/question-resources/mistletoe.jpg"], ["question-resources/words.png", "/srv/numbas/media/question-resources/words.png"], ["question-resources/santastuck_BCAneMV.svg", "/srv/numbas/media/question-resources/santastuck_BCAneMV.svg"], ["question-resources/christmas-money-2947946_1280_b6KFy88.png", "/srv/numbas/media/question-resources/christmas-money-2947946_1280_b6KFy88.png"]]}