// Numbas version: finer_feedback_settings {"name": "Explore mode demo", "metadata": {"description": "

Some questions demonstrating how explore mode can be used.

", "licence": "Creative Commons Attribution 4.0 International"}, "duration": 0, "percentPass": "0", "showQuestionGroupNames": false, "shuffleQuestionGroups": false, "showstudentname": true, "question_groups": [{"name": "Group", "pickingStrategy": "all-ordered", "pickQuestions": 1, "questionNames": ["", "", "", "", "", "", "", ""], "variable_overrides": [[], [], [], [], [], [], [], []], "questions": [{"name": "Decide if a coin is biased", "extensions": ["stats"], "custom_part_types": [{"source": {"pk": 1, "author": {"name": "Christian Lawson-Perfect", "pk": 7}, "edit_page": "/part_type/1/edit"}, "name": "Yes/no", "short_name": "yes-no", "description": "

The student is shown two radio choices: \"Yes\" and \"No\". One of them is correct.

", "help_url": "", "input_widget": "radios", "input_options": {"correctAnswer": "if(eval(settings[\"correct_answer_expr\"]), 0, 1)", "hint": {"static": true, "value": ""}, "choices": {"static": true, "value": ["Yes", "No"]}}, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\nif(studentanswer=correct_answer,\n correct(),\n incorrect()\n)\n\ninterpreted_answer:\nstudentAnswer=0\n\ncorrect_answer:\nif(eval(settings[\"correct_answer_expr\"]),0,1)", "marking_notes": [{"name": "mark", "description": "This is the main marking note. It should award credit and provide feedback based on the student's answer.", "definition": "if(studentanswer=correct_answer,\n correct(),\n incorrect()\n)"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "studentAnswer=0"}, {"name": "correct_answer", "description": "", "definition": "if(eval(settings[\"correct_answer_expr\"]),0,1)"}], "settings": [{"name": "correct_answer_expr", "label": "Is the answer \"Yes\"?", "help_url": "", "hint": "An expression which evaluates to true or false.", "input_type": "mathematical_expression", "default_value": "true", "subvars": false}], "public_availability": "always", "published": true, "extensions": []}], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "http://localhost:8000/accounts/profile/1/"}, {"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "tags": [], "metadata": {"description": "An interactive experiment about probability: the student must first 'design' the experiment by deciding how many times they're going to flip a coin, and define what number of heads would make them believe the coin is biased. They must then enter the results of their coin flips, calculate the percentage of heads, and finally decide if the coin is biased, using the condition they specified in the design stage. There are optional hints at each stage.
", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "", "advice": "", "rulesets": {}, "variables": {"flips": {"name": "flips", "group": "Ungrouped variables", "definition": "parse_flips(flips_string)", "description": "", "templateType": "anything"}, "flips_string": {"name": "flips_string", "group": "Ungrouped variables", "definition": "join(repeat(random(\"h\",\"t\"),num_flips),\" \")", "description": "", "templateType": "anything"}, "num_flips": {"name": "num_flips", "group": "Ungrouped variables", "definition": "100", "description": "", "templateType": "anything"}, "num_heads": {"name": "num_heads", "group": "Ungrouped variables", "definition": "len(filter(x,x,flips))", "description": "", "templateType": "anything"}, "num_tails": {"name": "num_tails", "group": "Ungrouped variables", "definition": "len(flips)-num_heads", "description": "", "templateType": "anything"}, "percent_heads": {"name": "percent_heads", "group": "Ungrouped variables", "definition": "100*num_heads/len(flips)", "description": "", "templateType": "anything"}, "cleaned_flips_string": {"name": "cleaned_flips_string", "group": "Ungrouped variables", "definition": "join(map(if(x,\"H\",\"T\"),x,flips),\" \")", "description": "", "templateType": "anything"}, "critical_number": {"name": "critical_number", "group": "Ungrouped variables", "definition": "max(raw_critical_number, num_flips-raw_critical_number)", "description": "", "templateType": "anything"}, "is_biased": {"name": "is_biased", "group": "Ungrouped variables", "definition": "num_heads>=critical_number or num_tails>=critical_number", "description": "", "templateType": "anything"}, "raw_critical_number": {"name": "raw_critical_number", "group": "Ungrouped variables", "definition": "60", "description": "", "templateType": "anything"}, "critical_likelihood": {"name": "critical_likelihood", "group": "Ungrouped variables", "definition": "critical_number/num_flips", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["num_flips", "raw_critical_number", "critical_number", "flips_string", "flips", "num_heads", "num_tails", "percent_heads", "cleaned_flips_string", "is_biased", "critical_likelihood"], "variable_groups": [], "functions": {"parse_flips": {"parameters": [["s", "string"]], "type": "list", "language": "javascript", "definition": "s = s.toLowerCase().replace(/[^ht]/g,'');\nreturn s.split('').map(function(c) { return new Numbas.jme.types.TBool(c=='h'); });"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "information", "useCustomName": true, "customName": "Introduction", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Decide number of flips", "rawLabel": "", "otherPart": 1, "variableReplacements": [], "availabilityCondition": "", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

In this exercise you will decide if a coin is biased by flipping it repeatedly and deciding if it lands heads more often than you'd expect.

"}, {"type": "numberentry", "useCustomName": true, "customName": "Decide number of flips", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Define 'biased'", "rawLabel": "", "otherPart": 2, "variableReplacements": [{"variable": "num_flips", "definition": "interpreted_answer"}], "availabilityCondition": "answered", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Design the experiment", "prompt": "

How many times will you flip your coin?

", "minValue": "1", "maxValue": "infinity", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "Define 'biased'", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Enter data", "rawLabel": "", "otherPart": 4, "variableReplacements": [{"variable": "raw_critical_number", "definition": "interpreted_answer"}], "availabilityCondition": "answered and credit=1", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}, {"label": "What do you expect an unbiased coin do?", "rawLabel": "", "otherPart": 3, "variableReplacements": [], "availabilityCondition": "not (answered or credit=1)", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Design the experiment", "prompt": "

How many heads would make you think the coin is biased?

", "minValue": "0", "maxValue": "100", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "What do you expect an unbiased coin do?", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": true, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

With an unbiased coin, how many flips would you expect to land heads up?

", "minValue": "num_flips/2-0.5", "maxValue": "num_flips/2+0.5", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "patternmatch", "useCustomName": true, "customName": "Enter data", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "right_length:\n if(len(parse_flips(studentAnswer))=num_flips,\n correct(\"You have entered your data correctly.\"),\n incorrect(\"You have not entered the right number of flips.\")\n )\n\nmark:\n apply(right_length)\n", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Calculate proportion of heads", "rawLabel": "", "otherPart": 5, "variableReplacements": [{"variable": "flips_string", "definition": "interpreted_answer"}], "availabilityCondition": "answered", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Enter data", "prompt": "

Flip the coin {num_flips} times. Each time it lands heads, write an H in the box below. Each time it lands tails, write a T.

", "answer": "[, hHtT]*", "displayAnswer": "", "matchMode": "regex"}, {"type": "numberentry", "useCustomName": true, "customName": "Calculate proportion of heads", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Show frequencies of heads and tails", "rawLabel": "", "otherPart": 6, "variableReplacements": [], "availabilityCondition": "not (answered and credit=1)", "penalty": "Showed frequencies of heads and tails", "penaltyAmount": "1", "lockAfterLeaving": false}, {"label": "Is the coin biased?", "rawLabel": "", "otherPart": 7, "variableReplacements": [], "availabilityCondition": "answered", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Calculate proportion of heads", "prompt": "

Your flips were:

\n

{cleaned_flips_string}

\n

What percentage of the flips landed heads?

", "minValue": "percent_heads", "maxValue": "percent_heads", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "dp", "precision": 0, "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "information", "useCustomName": true, "customName": "Show frequencies of heads and tails", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": true, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "\n\n\n\n\n\n\n\n\n\n\n\n\n
ResultHeadsTails
Frequency{num_heads}{num_tails}
"}, {"type": "yes-no", "useCustomName": true, "customName": "Is the coin biased?", "marks": "5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Calculate the critical likelihood", "rawLabel": "", "otherPart": 8, "variableReplacements": [], "availabilityCondition": "not (answered and credit=1)", "penalty": "Hint about critical likelihood", "penaltyAmount": "1", "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Decide if the coin is biased", "prompt": "

Do you think your coin is biased?

", "settings": {"correct_answer_expr": "is_biased"}}, {"type": "numberentry", "useCustomName": true, "customName": "Calculate the critical likelihood", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": true, "adaptiveMarkingPenalty": 0, "exploreObjective": "Decide if the coin is biased", "prompt": "

You said that a coin is biased if it comes up heads at least {critical_number} times out of {num_flips}. What's that as a percentage?

", "minValue": "100*critical_likelihood", "maxValue": "100*critical_likelihood", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "dp", "precision": 0, "precisionPartialCredit": "100", "precisionMessage": "", "strictPrecision": false, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "partsMode": "explore", "maxMarks": 0, "objectives": [{"name": "Calculate proportion of heads", "limit": "2", "mode": "sum"}, {"name": "Decide if the coin is biased", "limit": "5", "mode": "sum"}, {"name": "Design the experiment", "limit": "2", "mode": "sum"}, {"name": "Enter data", "limit": "1", "mode": "sum"}], "penalties": [{"name": "Showed frequencies of heads and tails", "limit": "1", "mode": "sum"}, {"name": "Hint about critical likelihood", "limit": "1", "mode": "sum"}], "objectiveVisibility": "always", "penaltyVisibility": "when-active", "type": "question"}, {"name": "Factorise a number", "extensions": ["stats"], "custom_part_types": [{"source": {"pk": 1, "author": {"name": "Christian Lawson-Perfect", "pk": 7}, "edit_page": "/part_type/1/edit"}, "name": "Yes/no", "short_name": "yes-no", "description": "

The student is shown two radio choices: \"Yes\" and \"No\". One of them is correct.

", "help_url": "", "input_widget": "radios", "input_options": {"correctAnswer": "if(eval(settings[\"correct_answer_expr\"]), 0, 1)", "hint": {"static": true, "value": ""}, "choices": {"static": true, "value": ["Yes", "No"]}}, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\nif(studentanswer=correct_answer,\n correct(),\n incorrect()\n)\n\ninterpreted_answer:\nstudentAnswer=0\n\ncorrect_answer:\nif(eval(settings[\"correct_answer_expr\"]),0,1)", "marking_notes": [{"name": "mark", "description": "This is the main marking note. It should award credit and provide feedback based on the student's answer.", "definition": "if(studentanswer=correct_answer,\n correct(),\n incorrect()\n)"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "studentAnswer=0"}, {"name": "correct_answer", "description": "", "definition": "if(eval(settings[\"correct_answer_expr\"]),0,1)"}], "settings": [{"name": "correct_answer_expr", "label": "Is the answer \"Yes\"?", "help_url": "", "hint": "An expression which evaluates to true or false.", "input_type": "mathematical_expression", "default_value": "true", "subvars": false}], "public_availability": "always", "published": true, "extensions": []}], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "http://localhost:8000/accounts/profile/1/"}, {"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "tags": [], "metadata": {"description": "An example of an iterative procedure: the student must factorise a given number. At each step, they're asked if the number is factorised. If not, they must give a prime factor. If it is fully factorised, they can then work out the number of factors of the number.
", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "", "advice": "

This is advice.

", "rulesets": {}, "variables": {"n": {"name": "n", "group": "Ungrouped variables", "definition": "prod(actual_factors)", "description": "

The number to factorise.

", "templateType": "anything"}, "factors": {"name": "factors", "group": "Ungrouped variables", "definition": "[]", "description": "

The prime factors entered by the student.

", "templateType": "anything"}, "fully_factorised": {"name": "fully_factorised", "group": "Ungrouped variables", "definition": "all(map(mod(current_n,k)<>0,k,2..floor(sqrt(current_n))))", "description": "

Is the number fully factorised? True if no integer between 2 and $\\sqrt{\\texttt{current_n}}$ divides current_n, so it's prime.

", "templateType": "anything"}, "current_n": {"name": "current_n", "group": "Ungrouped variables", "definition": "n/prod(factors)", "description": "

The part of $n$ still left to factorise.

", "templateType": "anything"}, "weighted_primes": {"name": "weighted_primes", "group": "Ungrouped variables", "definition": "[2,2,2,2,3,3,3,5,5,7,11]", "description": "

A list of prime numbers, weighted so smaller primes are picked more often

", "templateType": "anything"}, "num_factors": {"name": "num_factors", "group": "Ungrouped variables", "definition": "prod(map(len(filter(x=k,x,actual_factors))+1,k,set(actual_factors)))", "description": "

The number of factors of $n$.

", "templateType": "anything"}, "actual_factors": {"name": "actual_factors", "group": "Ungrouped variables", "definition": "repeat(random(weighted_primes),3)", "description": "

Pick three (not necessarily unique) prime factors for $n$.

", "templateType": "anything"}, "factorisation_latex": {"name": "factorisation_latex", "group": "Ungrouped variables", "definition": "latex(current_n+if(len(factors),' \\\\times '+join(factors,' \\\\times '),''))", "description": "

LaTeX expression showing the current statre of the factorisation.

", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["weighted_primes", "actual_factors", "n", "factors", "fully_factorised", "current_n", "num_factors", "factorisation_latex"], "variable_groups": [], "functions": {"isprime": {"parameters": [["n", "number"]], "type": "boolean", "language": "jme", "definition": "n>=2 and isint(n) and all(map(mod(n,k)>0,k,2..floor(sqrt(n))))"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "yes-no", "useCustomName": true, "customName": "Is it factorised?", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Write a factor", "rawLabel": "", "otherPart": 1, "variableReplacements": [], "availabilityCondition": "not interpreted_answer", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}, {"label": "How many factors?", "rawLabel": "", "otherPart": 2, "variableReplacements": [], "availabilityCondition": "interpreted_answer", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Is $\\var{n} = \\var{factorisation_latex}$ fully factorised?

", "settings": {"correct_answer_expr": "fully_factorised"}}, {"type": "numberentry", "useCustomName": true, "customName": "Write a factor", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "is_factor:\n if(mod(current_n,studentNumber)=0,\n if(isprime(studentNumber),\n correct()\n ,\n set_credit(0.5,\"Your answer is a factor of {current_n} but is not prime.\")\n )\n ,\n incorrect(\"Your answer is not a factor of {current_n}\")\n )\n \n\nmark (Mark the student's answer):\n apply(validNumber);\n apply(is_factor)", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Is it factorised?", "rawLabel": "", "otherPart": 0, "variableReplacements": [{"variable": "factors", "definition": "factors+[interpreted_answer]"}], "availabilityCondition": "answered and credit=1", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Identify the factors of $\\var{n}$", "prompt": "

Write a prime factor of $\\var{current_n}$.

", "minValue": "1", "maxValue": "1", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "How many factors?", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Calculate how many factors", "prompt": "

How many factors does $\\var{n} = \\var{factorisation_latex}$ have?

", "minValue": "num_factors", "maxValue": "num_factors", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "partsMode": "explore", "maxMarks": "4", "objectives": [{"name": "Identify the factors of $\\var{n}$", "limit": "3", "mode": "sum"}, {"name": "Calculate how many factors", "limit": "2", "mode": "sum"}], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Find Dracula", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "http://localhost:8000/accounts/profile/1/"}, {"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "tags": [], "metadata": {"description": "This question demonstrates how to use explore mode to simulate a game, where each choice made by the student changes the state of the game.
", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

You're trying to find Dracula. You've reached the grand gallery of Castle Dracula, and you know that the Count is hiding in one of the rooms. But which?

\n

All the rooms are on one side of the gallery. They each have internal doors between them, that only Dracula can use. Each time you look in a room that Dracula isn't in, he moves from the room he's in to an adjacent one.

\n

Can you find Dracula?

", "advice": "", "rulesets": {}, "variables": {"cells": {"name": "cells", "group": "Ungrouped variables", "definition": "repeat(true,n)", "description": "

For each room, whether Dracula can be in that room.

", "templateType": "anything"}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "4", "description": "

The number of rooms

", "templateType": "anything"}, "cells_after_pick": {"name": "cells_after_pick", "group": "Ungrouped variables", "definition": "map(\n let(ncells,map(if(k=j,false,cells[k]),k,0..n-1),\n map(if(k>0,ncells[k-1],false) or if(kFor each room, the value of cells after looking in that room.

", "templateType": "anything"}, "room_names": {"name": "room_names", "group": "Ungrouped variables", "definition": "map(\"Room \"+j,j,1..n)", "description": "

The names of the rooms, for display.

", "templateType": "anything"}, "dracula": {"name": "dracula", "group": "Ungrouped variables", "definition": "random(0..n-1)", "description": "

The room Dracula is in.

", "templateType": "anything"}, "dracula_choices": {"name": "dracula_choices", "group": "Ungrouped variables", "definition": "switch(\n dracula=0,[1],\n dracula=n-1,[n-2],\n [dracula-1,dracula+1]\n)", "description": "

The rooms Dracula can move to.

", "templateType": "anything"}, "chosen_room": {"name": "chosen_room", "group": "Ungrouped variables", "definition": "0", "description": "

The last room that was looked in.

", "templateType": "anything"}, "look_marking": {"name": "look_marking", "group": "Ungrouped variables", "definition": "map(award(1,j=dracula),j,0..n-1)", "description": "

Award 1 mark for looking in the room containing Dracula.

", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["n", "dracula", "cells", "cells_after_pick", "room_names", "dracula_choices", "chosen_room", "look_marking"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": true, "customName": "How many rooms does Castle Dracula have?", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Look in a room", "rawLabel": "", "otherPart": 1, "variableReplacements": [{"variable": "n", "definition": "interpreted_answer"}], "availabilityCondition": "answered", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

How many rooms does Castle Dracula have?

\n

(You can pick - a smaller number is easier, while a larger number will mean it takes longer to find Dracula)

", "minValue": "1", "maxValue": "100", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "1_n_2", "useCustomName": true, "customName": "Look in a room", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "student_choice: indices(interpreted_answer,[true])[0]", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Open the door", "rawLabel": "Open the door", "otherPart": 2, "variableReplacements": [{"variable": "chosen_room", "definition": "student_choice"}, {"variable": "cells", "definition": "cells_after_pick[student_choice]"}, {"variable": "dracula", "definition": "random(dracula_choices)"}], "availabilityCondition": "answered and student_choice<>dracula", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}, {"label": "Open the door", "rawLabel": "Open the door", "otherPart": 4, "variableReplacements": [], "availabilityCondition": "answered and student_choice=dracula", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Find Dracula", "prompt": "

Which room would you like to look in now?

", "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": "map(\"Room \"+j,j,1..n)", "matrix": "repeat(0,n)"}, {"type": "information", "useCustomName": true, "customName": "Dracula wasn't in the room", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Where could Dracula be?", "rawLabel": "", "otherPart": 3, "variableReplacements": [], "availabilityCondition": "", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}, {"label": "Look in another room", "rawLabel": "Look in another room", "otherPart": 1, "variableReplacements": [], "availabilityCondition": "", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Dracula wasn't in room {chosen_room+1}. Drat!

\n

You go back to the hall, and close the door. Dracula leaves the room he is in and moves to an adjacent room.

"}, {"type": "m_n_2", "useCustomName": true, "customName": "Where could Dracula be?", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": true, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Which rooms could Dracula be in right now?

", "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "checkbox", "displayColumns": 0, "minAnswers": 0, "maxAnswers": 0, "warningType": "none", "showCellAnswerState": true, "choices": "room_names", "matrix": "map(if(cells[k],1,-1),k,0..n-1)"}, {"type": "1_n_2", "useCustomName": true, "customName": "Confront Dracula!", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Find Dracula", "prompt": "

You open the door and find the dread Count himself!

\n

What do you do?

", "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": ["A quick stake to the heart and the job's done. Bish bash bosh!", "Let him go."], "matrix": ["1", 0], "distractors": ["", ""]}], "partsMode": "explore", "maxMarks": 0, "objectives": [{"name": "Find Dracula", "limit": "1", "mode": "sum"}], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Find the root(s) of a quadratic equation.", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "http://localhost:8000/accounts/profile/1/"}, {"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "tags": [], "metadata": {"description": "The student is asked to identify the number of roots of a quadratic equation, and then to give the root or roots. There is a hint to calculate the discriminant, and then further hints with the formula for the discriminant and the decision to make based on its value.
", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

$f(x) = \\simplify{{c1}x^2 + {c2}x + {c3}}$

", "advice": "", "rulesets": {}, "variables": {"root1": {"name": "root1", "group": "Ungrouped variables", "definition": "random(-5..5)", "description": "", "templateType": "anything"}, "root2": {"name": "root2", "group": "Ungrouped variables", "definition": "random(root1,random(-5..5 except root1))", "description": "

50% chance of being the same as root1

", "templateType": "anything"}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "random([1,1,1]+list(2..7))", "description": "", "templateType": "anything"}, "c1": {"name": "c1", "group": "Ungrouped variables", "definition": "a", "description": "", "templateType": "anything"}, "c2": {"name": "c2", "group": "Ungrouped variables", "definition": "a*(-root2 -root1)", "description": "", "templateType": "anything"}, "c3": {"name": "c3", "group": "Ungrouped variables", "definition": "a*root1*root2", "description": "", "templateType": "anything"}, "num_roots": {"name": "num_roots", "group": "Ungrouped variables", "definition": "if(root1=root2,1,2)", "description": "", "templateType": "anything"}, "discriminant": {"name": "discriminant", "group": "Ungrouped variables", "definition": "c2^2-4*c1*c3", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["root1", "root2", "a", "c1", "c2", "c3", "num_roots", "discriminant"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": true, "customName": "How many roots?", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Enter the root", "rawLabel": "", "otherPart": 1, "variableReplacements": [], "availabilityCondition": "interpreted_answer=1", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}, {"label": "Enter the roots", "rawLabel": "", "otherPart": 2, "variableReplacements": [], "availabilityCondition": "interpreted_answer=2", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}, {"label": "Calculate the discriminant", "rawLabel": "", "otherPart": 3, "variableReplacements": [], "availabilityCondition": "credit<1", "penalty": "Discriminant hint", "penaltyAmount": "0.5", "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Write the number of roots", "prompt": "

How many distinct solutions does $f(x)=0$ have?

", "minValue": "num_roots", "maxValue": "num_roots", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "Enter the root", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "mark (Mark the student's answer):\n apply(validNumber);\n if(studentNumber in [root1,root2],\n correct(),\n incorrect(\"Your answer is not a root of the equation\")\n )", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Identify the root(s)", "minValue": "root1", "maxValue": "root1", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "gapfill", "useCustomName": true, "customName": "Enter the roots", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "distinct_roots: \n set(answers)\n\ncorrect_roots:\n filter(x in [root1,root2],x,distinct_roots)\n\nincorrect_roots:\n filter(not (x in [root1,root2]),x,distinct_roots)\n\nq1: len(correct_roots)=len(set([root1,root2]))\n\nq:\n switch(\n len(correct_roots)=len(set([root1,root2])),\n correct();\n if(len(incorrect_roots)>0,\n sub_credit(0.5,\"One of your answers is not a solution of the equation $f(x) = 0$.\")\n ),\n len(correct_roots)>0,\n if(len(incorrect_roots)>0,\n set_credit(0.5,\"One of your answers is not a solution of the equation $f(x) = 0$.\"),\n set_credit(0.5,\"You have written the same solution twice.\")\n ),\n //otherwise\n incorrect(\"Neither of your answers is a solution of the equation $f(x) = 0$.\")\n )\n\nmark:\n assert(all_valid or not settings[\"sortAnswers\"], fail(translate(\"question.can not submit\")));\n apply(q)", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Identify the root(s)", "prompt": "

Write the two roots, $x_1$ and $x_2$, of the equation $f(x)=0$, such that $x_1 \\lt x_2$:

\n

$x_1 = $ [[0]]

\n

$x_2 = $ [[1]]

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "$x_1$", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Identify the root(s)", "minValue": "min(root1,root2)", "maxValue": "min(root1,root2)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "$x_2$", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Identify the root(s)", "minValue": "max(root1,root2)", "maxValue": "max(root1,root2)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": true}, {"type": "numberentry", "useCustomName": true, "customName": "Calculate the discriminant", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "See how to calculate the discriminant", "rawLabel": "See how to calculate the discriminant", "otherPart": 4, "variableReplacements": [], "availabilityCondition": "", "penalty": "Formula for the discriminant", "penaltyAmount": "0.25", "lockAfterLeaving": false}, {"label": "What to do with the discriminant", "rawLabel": "", "otherPart": 5, "variableReplacements": [], "availabilityCondition": "answered and credit=1", "penalty": "What to do with the discriminant", "penaltyAmount": "0.25", "lockAfterLeaving": false}], "suggestGoingBack": true, "adaptiveMarkingPenalty": 0, "exploreObjective": "Calculate the discriminant", "prompt": "

What is the discriminant of $f(x)$?

", "minValue": "discriminant", "maxValue": "discriminant", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "information", "useCustomName": true, "customName": "Discriminant formula", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": true, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

For a quadratic equation in the form $ax^2 + bx + c$, the discriminant $D$ is

\n

\\[ D = b^2-4ac \\]

"}, {"type": "information", "useCustomName": true, "customName": "What to do with the discriminant", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": true, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The number of distinct roots of the equation depends on the value of the discriminant:

\n"}], "partsMode": "explore", "maxMarks": "3", "objectives": [{"name": "Write the number of roots", "limit": "1", "mode": "sum"}, {"name": "Identify the root(s)", "limit": "2", "mode": "sum"}, {"name": "Calculate the discriminant", "limit": "0.5", "mode": "sum"}], "penalties": [{"name": "Discriminant hint", "limit": "0.5", "mode": "sum"}, {"name": "Formula for the discriminant", "limit": "0.25", "mode": "sum"}, {"name": "What to do with the discriminant", "limit": "0.25", "mode": "sum"}], "objectiveVisibility": "when-active", "penaltyVisibility": "when-active", "type": "question"}, {"name": "Lock a part after leaving it", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "http://localhost:8000/accounts/profile/1/"}, {"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "tags": [], "metadata": {"description": "This question demonstrates how to lock a part in explore mode after moving to the next part, to prevent the student changing their answer and invalidating the rest of the question.
", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "", "advice": "", "rulesets": {}, "variables": {"x": {"name": "x", "group": "Ungrouped variables", "definition": "1", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["x"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": true, "customName": "Enter a number", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Double the number", "rawLabel": "", "otherPart": 1, "variableReplacements": [{"variable": "x", "definition": "interpreted_answer"}], "availabilityCondition": "answered", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": true}, {"label": "Get some inspiration", "rawLabel": "", "otherPart": 2, "variableReplacements": [], "availabilityCondition": "not (answered and credit=1)", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Write a number.

", "minValue": "-infinity", "maxValue": "infinity", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "Double the number", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Double the number", "prompt": "

$x = \\var{x}$.

\n

What is $2x$?

", "minValue": "2x", "maxValue": "2x", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "information", "useCustomName": true, "customName": "Get some inspiration", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": true, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Maybe you'd like to write the number {random(100..200)}?

"}], "partsMode": "explore", "maxMarks": 0, "objectives": [{"name": "Double the number", "limit": 1, "mode": "sum"}], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Offer hints at different levels of detail", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "http://localhost:8000/accounts/profile/1/"}, {"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "tags": [], "metadata": {"description": "This question demonstrates how you can offer a selection of hints, with each giving a different level of detail and applying a different penalty.
", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "", "advice": "", "rulesets": {}, "variables": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": true, "customName": "Write a number", "marks": "10", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Vague hint", "rawLabel": "", "otherPart": 1, "variableReplacements": [], "availabilityCondition": "", "penalty": "Hints revealed", "penaltyAmount": "1", "lockAfterLeaving": false}, {"label": "More specific hint", "rawLabel": "", "otherPart": 2, "variableReplacements": [], "availabilityCondition": "", "penalty": "Hints revealed", "penaltyAmount": "2", "lockAfterLeaving": false}, {"label": "Guided steps", "rawLabel": "", "otherPart": 3, "variableReplacements": [], "availabilityCondition": "", "penalty": "Hints revealed", "penaltyAmount": "3", "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Write the number 3435", "prompt": "

In this question, you need to write the number 3435.

\n

If you need help, ask for a hint.

", "minValue": "3435", "maxValue": "3435", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "information", "useCustomName": true, "customName": "Vague hint", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": true, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The thing you need to write is an integer.

"}, {"type": "information", "useCustomName": true, "customName": "More specific hint", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": true, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Use the digit keys on your keyboard to write the number.

"}, {"type": "gapfill", "useCustomName": true, "customName": "Guided steps", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": true, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Try writing the digits one at a time.

\n

Write 3: [[0]]

\n

Write 4: [[1]]

\n

Write 3 again: [[2]]

\n

Write 5: [[3]]

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "Write 3", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Write the number 3435", "minValue": "3", "maxValue": "3", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "Write 4", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Write the number 3435", "minValue": "4", "maxValue": "4", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "Write 3 again", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Write the number 3435", "minValue": "3", "maxValue": "3", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "Write 5", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Write the number 3435", "minValue": "5", "maxValue": "5", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "explore", "maxMarks": 0, "objectives": [{"name": "Write the number 3435", "limit": "10", "mode": "sum"}], "penalties": [{"name": "Hints revealed", "limit": "3", "mode": "sum"}], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "exam"}, {"name": "Posting a parcel", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "http://localhost:8000/accounts/profile/1/"}, {"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "tags": [], "metadata": {"description": "An interactive activity: the student enters the dimensions of a parcel, then has to calculate its volume, and classify its size by comparing against a table of maximum dimensions.
", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "", "advice": "", "rulesets": {}, "variables": {"width": {"name": "width", "group": "Ungrouped variables", "definition": "10", "description": "", "templateType": "anything"}, "length": {"name": "length", "group": "Ungrouped variables", "definition": "10", "description": "", "templateType": "anything"}, "height": {"name": "height", "group": "Ungrouped variables", "definition": "3", "description": "", "templateType": "anything"}, "volume": {"name": "volume", "group": "Ungrouped variables", "definition": "width*length*height", "description": "", "templateType": "anything"}, "sizes": {"name": "sizes", "group": "Ungrouped variables", "definition": "[\n [name: \"Small\", width: 20, length: 20, height: 5, volume: 300],\n [name: \"Medium\", width: 40, length: 40, height: 30, volume: 6000],\n [name: \"Large\", width: 60, length: 60, height: 60, volume: 27000],\n [name: \"Too large\", width: infinity, length: infinity, height: infinity, volume: infinity]\n]", "description": "", "templateType": "anything"}, "valid_sizes": {"name": "valid_sizes", "group": "Ungrouped variables", "definition": "map(\n let(\n sdims,sort([size[\"width\"],size[\"height\"],size[\"length\"]])+[size[\"volume\"]],\n all(map(x<=y,[x,y],zip(dimensions,sdims)))\n )\n ,\n size,\n sizes\n)", "description": "", "templateType": "anything"}, "dimensions": {"name": "dimensions", "group": "Ungrouped variables", "definition": "sort([width,length,height])+[volume]", "description": "", "templateType": "anything"}, "best_size": {"name": "best_size", "group": "Ungrouped variables", "definition": "filter(valid_sizes[j],j,0..len(sizes)-1)[0]", "description": "", "templateType": "anything"}, "size_table": {"name": "size_table", "group": "Ungrouped variables", "definition": "table(\n map(\n [size[\"name\"],size[\"width\"],size[\"length\"],size[\"height\"], separateThousands(size[\"volume\"],\",\")],\n size,\n sizes[0..len(sizes)-1]\n ),\n [\"Size\", \"Max. width (cm)\", \"Max. length (cm)\", \"Max. height (cm)\", \"Max. volume (cm\u00b3)\"]\n)", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["width", "length", "height", "volume", "dimensions", "sizes", "valid_sizes", "best_size", "size_table"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "information", "useCustomName": true, "customName": "Introduction", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Enter the parcel's measurements", "rawLabel": "", "otherPart": 1, "variableReplacements": [], "availabilityCondition": "", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

You would like to post a parcel. The cost of postage depends on the size of your parcel.

"}, {"type": "gapfill", "useCustomName": true, "customName": "Enter the parcel's measurements", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Calculate volume", "rawLabel": "", "otherPart": 2, "variableReplacements": [{"variable": "width", "definition": "interpreted_answer[0]"}, {"variable": "height", "definition": "interpreted_answer[1]"}, {"variable": "length", "definition": "interpreted_answer[2]"}], "availabilityCondition": "answered", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Enter the dimensions of your parcel, in centimetres.

\n

Width: [[0]]

\n

Length: [[1]]

\n

Height: [[2]]

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "Width", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "0", "maxValue": "infinity", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "Length", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "0", "maxValue": "infinity", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "Height", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "0", "maxValue": "infinity", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "numberentry", "useCustomName": true, "customName": "Calculate volume", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Pick the appropriate size", "rawLabel": "", "otherPart": 3, "variableReplacements": [], "availabilityCondition": "answered", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Calculate the parcel's volume", "prompt": "

Your parcel measures $\\var{width} \\times \\var{length} \\times \\var{height}$cm.

\n

What is the volume of your parcel, in cubic centimetres?

", "minValue": "volume", "maxValue": "volume", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "1_n_2", "useCustomName": true, "customName": "Pick the appropriate size", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Pick the size of the parcel", "prompt": "

The post company categorises parcels according to the following table:

\n

{size_table}

\n

What size is your parcel?

", "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": "map(size[\"name\"],size,sizes)", "matrix": "map(award(1,x=best_size), x, 0..len(sizes)-1)"}], "partsMode": "explore", "maxMarks": 0, "objectives": [{"name": "Calculate the parcel's volume", "limit": "1", "mode": "sum"}, {"name": "Pick the size of the parcel", "limit": "1", "mode": "sum"}], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "exam"}, {"name": "Show an optional hint when the student makes a particular error", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "http://localhost:8000/accounts/profile/1/"}, {"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "tags": [], "metadata": {"description": "This question shows how to reveal a part if the student enters an incorrect answer that you're expecting - in this case, by not following the order of operations.
", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "", "advice": "", "rulesets": {}, "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "random(1 .. 9#1)", "description": "", "templateType": "randrange"}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(2 .. 5#1)", "description": "", "templateType": "randrange"}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "random(2 .. 5#1)", "description": "", "templateType": "randrange"}, "d": {"name": "d", "group": "Ungrouped variables", "definition": "random(-5..5 except 0)", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "b", "c", "d"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": true, "customName": "Evaluate an expression", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Get a hint", "rawLabel": "Get a hint", "otherPart": 1, "variableReplacements": [], "availabilityCondition": "interpreted_answer=(a+b)*c+d", "penalty": "Hint", "penaltyAmount": "0.5", "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Evaluate an expression", "prompt": "

What is $\\simplify[]{ {a} + {b}*{c} + {d} }$?

", "minValue": "a+b*c+d", "maxValue": "a+b*c+d", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "information", "useCustomName": true, "customName": "Order of operations hint", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": true, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Did you evaluate the expression from left to right, without accounting for the order of operations?

\n

Perform multiplication first: $\\simplify[]{ {a} + {b}*{c} + {d} } = \\simplify[]{ {a} + {b*c} + {d} }$

"}], "partsMode": "explore", "maxMarks": 0, "objectives": [{"name": "Evaluate an expression", "limit": 1, "mode": "sum"}], "penalties": [{"name": "Hint", "limit": "0.5", "mode": "sum"}], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "exam"}]}], "allowPrinting": true, "navigation": {"allowregen": true, "reverse": true, "browse": true, "allowsteps": true, "showfrontpage": false, "showresultspage": "oncompletion", "navigatemode": "menu", "onleave": {"action": "none", "message": ""}, "preventleave": false, "typeendtoleave": false, "startpassword": "", "allowAttemptDownload": false, "downloadEncryptionKey": ""}, "timing": {"allowPause": true, "timeout": {"action": "none", "message": ""}, "timedwarning": {"action": "none", "message": ""}}, "feedback": {"showactualmark": true, "showtotalmark": true, "showanswerstate": true, "allowrevealanswer": true, "advicethreshold": 0, "intro": "", "end_message": "", "reviewshowscore": true, "reviewshowfeedback": true, "reviewshowexpectedanswer": true, "reviewshowadvice": true, "results_options": {"printquestions": true, "printadvice": true}, "feedbackmessages": [], "enterreviewmodeimmediately": true, "showexpectedanswerswhen": "inreview", "showpartfeedbackmessageswhen": "always", "showactualmarkwhen": "always", "showtotalmarkwhen": "always", "showanswerstatewhen": "always", "showadvicewhen": "inreview"}, "diagnostic": {"knowledge_graph": {"topics": [], "learning_objectives": []}, "script": "diagnosys", "customScript": ""}, "type": "exam", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "extensions": ["stats"], "custom_part_types": [{"source": {"pk": 1, "author": {"name": "Christian Lawson-Perfect", "pk": 7}, "edit_page": "/part_type/1/edit"}, "name": "Yes/no", "short_name": "yes-no", "description": "

The student is shown two radio choices: \"Yes\" and \"No\". One of them is correct.

", "help_url": "", "input_widget": "radios", "input_options": {"correctAnswer": "if(eval(settings[\"correct_answer_expr\"]), 0, 1)", "hint": {"static": true, "value": ""}, "choices": {"static": true, "value": ["Yes", "No"]}}, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\nif(studentanswer=correct_answer,\n correct(),\n incorrect()\n)\n\ninterpreted_answer:\nstudentAnswer=0\n\ncorrect_answer:\nif(eval(settings[\"correct_answer_expr\"]),0,1)", "marking_notes": [{"name": "mark", "description": "This is the main marking note. It should award credit and provide feedback based on the student's answer.", "definition": "if(studentanswer=correct_answer,\n correct(),\n incorrect()\n)"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "studentAnswer=0"}, {"name": "correct_answer", "description": "", "definition": "if(eval(settings[\"correct_answer_expr\"]),0,1)"}], "settings": [{"name": "correct_answer_expr", "label": "Is the answer \"Yes\"?", "help_url": "", "hint": "An expression which evaluates to true or false.", "input_type": "mathematical_expression", "default_value": "true", "subvars": false}], "public_availability": "always", "published": true, "extensions": []}], "resources": []}