// Numbas version: finer_feedback_settings {"name": "TALMO Formative assessment talk 2022", "metadata": {"description": "

Questions shown in my presentation for the Teaching And Learning Mathematics Online session, 16th November 2022.

", "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": "Feedback loop: is it correct?", "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/"}], "tags": [], "metadata": {"description": "

Two parts to demonstrate kinds of feedback loop in a Numbas part: correctness, and refining an answer.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "", "advice": "", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"expr": {"name": "expr", "group": "Ungrouped variables", "definition": "simplify(expression(\"{a}*sin({b}*x) + {c}*x^2+{a*b*c}\"), \"all\")", "description": "", "templateType": "anything", "can_override": false}, "a,b,c": {"name": "a,b,c", "group": "Ungrouped variables", "definition": "repeat(random(-5..5),3)", "description": "", "templateType": "anything", "can_override": false}, "m1": {"name": "m1", "group": "Ungrouped variables", "definition": "random(0..b1-1)", "description": "", "templateType": "anything", "can_override": false}, "m2": {"name": "m2", "group": "Ungrouped variables", "definition": "random(0..b2-1)", "description": "", "templateType": "anything", "can_override": false}, "m3": {"name": "m3", "group": "Ungrouped variables", "definition": "random(0..b3-1)", "description": "", "templateType": "anything", "can_override": false}, "b1,b2,b3": {"name": "b1,b2,b3", "group": "Ungrouped variables", "definition": "shuffle([3,5,7,11,13])", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a,b,c", "expr", "m1", "m2", "m3", "b1,b2,b3"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Calculate \\[ \\prod_{i=1}^5 2i \\]

", "alternatives": [{"type": "numberentry", "useCustomName": true, "customName": "Sum instead of prod", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "alternativeFeedbackMessage": "

I think you added the terms, instead of multiplying them.

\n

$\\prod$ means multiply the terms together.

", "useAlternativeFeedback": false, "minValue": "30", "maxValue": "30", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "minValue": "2^5 * 5!", "maxValue": "2^5 * 5!", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Feedback loop: how close are you?", "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/"}], "tags": [], "metadata": {"description": "

Demonstrating a kind of feedback loop in a Numbas part: you're told how close you are to the correct answer.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "", "advice": "", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"expr": {"name": "expr", "group": "Ungrouped variables", "definition": "simplify(expression(\"{a}*sin({b}*x) + {c}*x^2+{a*b*c}\"), \"all\")", "description": "", "templateType": "anything", "can_override": false}, "a,b,c": {"name": "a,b,c", "group": "Ungrouped variables", "definition": "repeat(random(-5..5),3)", "description": "", "templateType": "anything", "can_override": false}, "m1": {"name": "m1", "group": "Ungrouped variables", "definition": "random(0..b1-1)", "description": "", "templateType": "anything", "can_override": false}, "m2": {"name": "m2", "group": "Ungrouped variables", "definition": "random(0..b2-1)", "description": "", "templateType": "anything", "can_override": false}, "m3": {"name": "m3", "group": "Ungrouped variables", "definition": "random(0..b3-1)", "description": "", "templateType": "anything", "can_override": false}, "b1,b2,b3": {"name": "b1,b2,b3", "group": "Ungrouped variables", "definition": "shuffle([3,5,7,11,13])", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a,b,c", "b1,b2,b3", "expr", "m1", "m2", "m3"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Find, to 3 decimal places, a root of the following function:

\n

\\[ f(x) = \\var{expr} \\]

\n

$x = $ [[0]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "student_y: eval(expr, [\"x\": studentnumber])\n\nerror: abs(student_y)\n\nmark:\n apply(validNumber);\n if(error<10^-3,\n correct(\"$f(x) = \"+dpformat(student_y,3)+\"$, to three decimal places.\")\n ,\n negative_feedback(\"$f(x) = \"+dpformat(student_y,3)+\"$. Refine your answer and try again.\")\n )", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "0", "maxValue": "0", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Feedback loop: which properties are satisfied?", "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/"}], "tags": [], "metadata": {"description": "

Demonstrating a feedback loop in a Numbas part: which of the required properties does your answer satisfy?

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "", "advice": "", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"m1": {"name": "m1", "group": "Ungrouped variables", "definition": "random(0..b1-1)", "description": "", "templateType": "anything", "can_override": false}, "m2": {"name": "m2", "group": "Ungrouped variables", "definition": "random(0..b2-1)", "description": "", "templateType": "anything", "can_override": false}, "m3": {"name": "m3", "group": "Ungrouped variables", "definition": "random(0..b3-1)", "description": "", "templateType": "anything", "can_override": false}, "b1,b2,b3": {"name": "b1,b2,b3", "group": "Ungrouped variables", "definition": "shuffle([random(2,4,8),random(3,9),5])", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["b1,b2,b3", "m1", "m2", "m3"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "3", "scripts": {}, "customMarkingAlgorithm": "mods:\n map(\n if(mod(studentNumber,b)=m,\n add_credit(1/3, \"$\"+studentNumber+\" \\\\equiv \"+m+\" \\\\mod \"+b+\"$\")\n ,\n negative_feedback(\"$\"+studentNumber+\" \\\\equiv \"+mod(studentNumber,b)+\" \\\\mod \"+b+\"$\")\n ),\n [m,b],\n zip([m1,m2,m3],[b1,b2,b3])\n )\n\nmark:\n apply(validNumber);\n apply(mods)", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Write a number congruent to:

\n", "minValue": "0", "maxValue": "0", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Oracle: Isomorphisms of a binary tree", "extensions": ["eukleides", "permutations"], "custom_part_types": [{"source": {"pk": 133, "author": {"name": "Christian Lawson-Perfect", "pk": 7}, "edit_page": "/part_type/133/edit"}, "name": "Write an equivalent word", "short_name": "write-a-word-producing-a-given-permutation", "description": "

The student must write a word on the given generators which is equivalent to the given word.

\n

The generators are given as a dictionary mapping letters to permutations.

", "help_url": "", "input_widget": "string", "input_options": {"correctAnswer": "settings[\"correctWord\"]", "hint": {"static": true, "value": ""}, "allowEmpty": {"static": true, "value": false}}, "can_be_gap": true, "can_be_step": true, "marking_script": "generator_dict:\nsettings[\"generators\"]\n\nstudent_letters:\nsplit(replace_regex(\"[^a-z]\",\"\",lower(studentanswer),\"g\"),\"\")\n\nvalid_letters:\nassert(all(map(x in generator_dict,x,student_letters)),\n warn(\"Your word is invalid. You must only use letters corresponding to generators.\");\n fail(\"Your word is invalid. You must only use letters corresponding to generators.\")\n)\n\nstudent_word:\nmap(generator_dict[x],x,student_letters)\n\nstudent_perm:\niterate_until([p*word[-1],word[0..-1]],[p,word],[permutation(\"\"),student_word],len(word)=0)[-1][0]\n\ncorrect_letters:\nsplit(replace_regex(\"[^a-z]\",\"\",lower(settings[\"correctWord\"]),\"g\"),\"\")\n\ncorrect_word:\nmap(generator_dict[x],x,correct_letters)\n\ncorrect_perm:\niterate_until([p*word[-1],word[0..-1]],[p,word],[permutation(\"\"),correct_word],len(word)=0)[-1][0]\n\nperm_is_correct:\nif(student_perm=correct_perm,\n correct()\n, incorrect(\"Your answer is incorrect: your word produced the ordering \"+join(list(student_perm),' ')+\".\")\n)\n\nmark:\napply(valid_letters);\napply(perm_is_correct)\n\ninterpreted_answer:\nstudent_letters", "marking_notes": [{"name": "generator_dict", "description": "", "definition": "settings[\"generators\"]"}, {"name": "student_letters", "description": "

The letters in the student's word. Any non-letter characters are removed.

", "definition": "split(replace_regex(\"[^a-z]\",\"\",lower(studentanswer),\"g\"),\"\")"}, {"name": "valid_letters", "description": "

Are all of the letters in the student's word in the generator dictionary? Fail if not.

", "definition": "assert(all(map(x in generator_dict,x,student_letters)),\n warn(\"Your word is invalid. You must only use letters corresponding to generators.\");\n fail(\"Your word is invalid. You must only use letters corresponding to generators.\")\n)"}, {"name": "student_word", "description": "", "definition": "map(generator_dict[x],x,student_letters)"}, {"name": "student_perm", "description": "

The permutation produced by the student's word.

", "definition": "iterate_until([p*word[-1],word[0..-1]],[p,word],[permutation(\"\"),student_word],len(word)=0)[-1][0]"}, {"name": "correct_letters", "description": "", "definition": "split(replace_regex(\"[^a-z]\",\"\",lower(settings[\"correctWord\"]),\"g\"),\"\")"}, {"name": "correct_word", "description": "", "definition": "map(generator_dict[x],x,correct_letters)"}, {"name": "correct_perm", "description": "", "definition": "iterate_until([p*word[-1],word[0..-1]],[p,word],[permutation(\"\"),correct_word],len(word)=0)[-1][0]"}, {"name": "perm_is_correct", "description": "", "definition": "if(student_perm=correct_perm,\n correct()\n, incorrect(\"Your answer is incorrect: your word produced the ordering \"+join(list(student_perm),' ')+\".\")\n)"}, {"name": "mark", "description": "This is the main marking note. It should award credit and provide feedback based on the student's answer.", "definition": "apply(valid_letters);\napply(perm_is_correct)"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "student_letters"}], "settings": [{"name": "generators", "label": "Generators", "help_url": "", "hint": "A dictionary mapping letters to elements of the group.", "input_type": "code", "default_value": "", "evaluate": true}, {"name": "correctWord", "label": "Correct word", "help_url": "", "hint": "The word that the student must produce.", "input_type": "string", "default_value": "", "subvars": true}], "public_availability": "restricted", "published": false, "extensions": ["permutations"]}], "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/"}, {"name": "Andrew Duncan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/409/"}, {"name": "George Stagg", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/930/"}, {"name": "Sam Mutter", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/9360/"}], "tags": [], "metadata": {"description": "

Made for my TALMO talk. This demonstrates how you can use a part with no marks as an oracle to perform calculations, to help the student check their working.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

Consider the binary tree $B_\\var{depth}$ with $2^\\var{depth}$ leaves.

\n

{tree_diagram(depth,1..2^depth)}

\n

In the diagram, each dashed line represents the action of swapping the two branches of the tree on either side of the line, in place.

", "advice": "", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"word_to_apply": {"name": "word_to_apply", "group": "Ungrouped variables", "definition": "repeat(random(generator_names),5)", "description": "", "templateType": "anything", "can_override": false}, "generators": {"name": "generators", "group": "Ungrouped variables", "definition": "let(\n n, 2^depth,\n fn,expression(\"[flip(a,b,n)]+if(b-a>2, eval(fn,['a':a,'b':(a+b)/2])+eval(fn,['a':(a+b)/2,'b':b]),[])\"),\n eval(fn,['a':0,'b':n])\n)", "description": "

Generators for the isomorphism group of

", "templateType": "anything", "can_override": false}, "list_generators": {"name": "list_generators", "group": "Ungrouped variables", "definition": "html(\"\")", "description": "", "templateType": "anything", "can_override": false}, "commutes": {"name": "commutes", "group": "Ungrouped variables", "definition": "matrix(\n map(map(award(1,a*b=b*a),b,generators),a,generators)\n)", "description": "

Which of the generators commute with each other? 1 if they commute, 0 otherwise.

", "templateType": "anything", "can_override": false}, "depth": {"name": "depth", "group": "Ungrouped variables", "definition": "3", "description": "", "templateType": "anything", "can_override": false}, "generator_names": {"name": "generator_names", "group": "Ungrouped variables", "definition": "map(letterordinal(j),j,0..len(generators)-1)", "description": "

The names of each generator. The root node is called a, then the ones directly under it are called b and c, and so on.

", "templateType": "anything", "can_override": false}, "generator_dict": {"name": "generator_dict", "group": "Ungrouped variables", "definition": "dict(zip(generator_names,generators))", "description": "

A dictionary mapping generator names to the corresponding permutation of the leaves.

", "templateType": "anything", "can_override": false}, "permutation_to_produce": {"name": "permutation_to_produce", "group": "Ungrouped variables", "definition": "apply_word(word_to_produce)", "description": "

A permutation to be produced by a word given by the student.

", "templateType": "anything", "can_override": false}, "word_to_produce": {"name": "word_to_produce", "group": "Ungrouped variables", "definition": "shuffle(generator_names)[0..3]", "description": "

A word corresponding to the permutation that the student must produce.

\n

Chosen so that the student's word is at least 3 letters long.

", "templateType": "anything", "can_override": false}, "generator_to_reproduce": {"name": "generator_to_reproduce", "group": "Ungrouped variables", "definition": "random(generator_names[1..len(generator_names)])", "description": "

A generator that the student must write in terms of the other generators. $a$ is excluded, since it can't be written in terms of the others.

", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["depth", "generators", "generator_names", "generator_dict", "word_to_apply", "list_generators", "commutes", "word_to_produce", "permutation_to_produce", "generator_to_reproduce"], "variable_groups": [], "functions": {"flip": {"parameters": [["a", "number"], ["b", "number"], ["n", "number"]], "type": "permutation", "language": "jme", "definition": "permutation(let(\n l,(b-a)/2,\n map(\n switch(\n a<=j0,[\n b..point(x(b),(-depth-2)*y_spread) dashed gray description(\"reflection line through node {letterordinal(j)}\")\n , b label(letterordinal(j),deg(if(n=depth,45,90))) description(\"node {letterordinal(j)}\")\n ],[\n let(x,k+1-2^depth,leaf, leaf_labels[x],b label(leaf,deg(-90)) description(\"leaf labelled {leaf}\"))\n ])\n + if(n>0,\n eval(fn,['a':b,'b':b+vector(-x_spread*2^(n-1),-y_spread),'n':n-1,'j':j+1,'k':2k+1])\n + eval(fn,['a':b,'b':b+vector(x_spread*2^(n-1),-y_spread),'n':n-1,'j':j+2^(n-1),'k':2k+2])\n ,[]\n )\n \"\"\")),\n max_width(30,eukleides(\"A binary tree with depth {depth}\",eval(fn,['a':point(0,0),'b':point(0,-y_spread),'n':min(depth,5),'j':0,'k':0]))\n))\n "}}, "preamble": {"js": "", "css": ".part .feedbackMessages svg {\n width: 50em;\n}"}, "parts": [{"type": "write-a-word-producing-a-given-permutation", "useCustomName": true, "customName": "Experimentation", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "note: \n feedback(\"This word produces the following ordering:\");\n feedback(tree_diagram(depth,list(student_perm)))\n\nmark:\n apply(valid_letters);\n apply(note)", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

You can use this part to see how different words act on the graph.

\n

Each time you submit this part, you will be shown the order of the leaves under the action of the word you typed.

", "settings": {"generators": "generator_dict", "correctWord": "a"}}, {"type": "matrix", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

What are each of the leaves mapped to under the action of the word $\\var{latex(join(word_to_apply,' '))}$?

", "correctAnswer": "matrix(list(apply_word(word_to_apply)))", "correctAnswerFractions": false, "numRows": 1, "numColumns": "2^depth", "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}, {"type": "write-a-word-producing-a-given-permutation", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Write a word which produces the following ordering of the leaves:

\n

{join(list(permutation_to_produce),' ')}

", "settings": {"generators": "generator_dict", "correctWord": "{join(word_to_produce,\"\")}"}}, {"type": "write-a-word-producing-a-given-permutation", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "is_right_length: \n assert(len(student_letters)>=6,\n incorrect(\"Your word must contain at least 6 letters.\")\n )\n\nmark:\n apply(base_mark);\n apply(is_right_length)", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Write another word which produces that ordering of the leaves, of length at least 6.

", "settings": {"generators": "generator_dict", "correctWord": "{join(word_to_produce,\"\")}"}}, {"type": "m_n_x", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Which generators commute?

", "minMarks": 0, "maxMarks": 0, "minAnswers": 0, "maxAnswers": 0, "shuffleChoices": false, "shuffleAnswers": false, "displayType": "checkbox", "warningType": "none", "showCellAnswerState": true, "markingMethod": "sum ticked cells", "choices": "generator_names", "matrix": "commutes", "layout": {"type": "lowertriangle", "expression": ""}, "answers": "generator_names"}, {"type": "write-a-word-producing-a-given-permutation", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "didnt_use_target:\n assert(not (settings[\"correctWord\"] in student_letters),\n incorrect(\"You must not use the letter $\"+settings[\"correctWord\"]+\"$ in your word.\")\n )\n\nmark:\n apply(base_mark);\n apply(didnt_use_target)", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Write a word equivalent to the generator $\\var{latex(generator_to_reproduce)}$, without using $\\var{latex(generator_to_reproduce)}$.

", "settings": {"generators": "generator_dict", "correctWord": "{generator_to_reproduce}"}}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

What is the order of each of the generators?

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

What is the order of the group $\\Gamma(B_\\var{depth})$?

", "minValue": "2^(2^(depth)-1)", "maxValue": "2^(2^(depth)-1)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Give an expression for the order of $\\Gamma(B_n)$.

", "answer": "2^(2^n-1)", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "n", "value": ""}]}], "partsMode": "all", "maxMarks": 0, "objectives": [], "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": "Numbas demo: explore mode", "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/"}, {"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}, {"name": "Laura Midgley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/18287/"}], "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": "

Explore mode makes it possible to create open-ended questions, where the student is free to choose their own path.

\n

In this question, the student is guided through the steps of designing a probability experiment, and then assessed based on the criteria they chose.

\n

See this question in the public editor.

", "advice": "", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"flips": {"name": "flips", "group": "Ungrouped variables", "definition": "parse_flips_jme(flips_string)", "description": "", "templateType": "anything", "can_override": false}, "flips_string": {"name": "flips_string", "group": "Ungrouped variables", "definition": "join(repeat(random(\"h\",\"t\"),num_flips),\" \")", "description": "", "templateType": "anything", "can_override": false}, "num_flips": {"name": "num_flips", "group": "Ungrouped variables", "definition": "100", "description": "", "templateType": "anything", "can_override": false}, "num_heads": {"name": "num_heads", "group": "Ungrouped variables", "definition": "len(filter(x,x,flips))", "description": "", "templateType": "anything", "can_override": false}, "num_tails": {"name": "num_tails", "group": "Ungrouped variables", "definition": "len(flips)-num_heads", "description": "", "templateType": "anything", "can_override": false}, "percent_heads": {"name": "percent_heads", "group": "Ungrouped variables", "definition": "100*num_heads/len(flips)", "description": "", "templateType": "anything", "can_override": false}, "cleaned_flips_string": {"name": "cleaned_flips_string", "group": "Ungrouped variables", "definition": "join(map(if(x,\"H\",\"T\"),x,flips),\" \")", "description": "", "templateType": "anything", "can_override": false}, "critical_number": {"name": "critical_number", "group": "Ungrouped variables", "definition": "max(raw_critical_number, num_flips-raw_critical_number)", "description": "", "templateType": "anything", "can_override": false}, "is_biased": {"name": "is_biased", "group": "Ungrouped variables", "definition": "num_heads>=critical_number or num_tails>=critical_number", "description": "", "templateType": "anything", "can_override": false}, "raw_critical_number": {"name": "raw_critical_number", "group": "Ungrouped variables", "definition": "60", "description": "", "templateType": "anything", "can_override": false}, "critical_likelihood": {"name": "critical_likelihood", "group": "Ungrouped variables", "definition": "critical_number/num_flips", "description": "", "templateType": "anything", "can_override": false}}, "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'); });"}, "parse_flips_jme": {"parameters": [["s", "string"]], "type": "list", "language": "jme", "definition": "map(c='h',c,split(s,' '))"}}, "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, "showPenaltyHint": true, "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, "showPenaltyHint": true, "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, "displayAnswer": "", "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, "showPenaltyHint": true, "lockAfterLeaving": false}, {"label": "What do you expect an unbiased coin do?", "rawLabel": "", "otherPart": 3, "variableReplacements": [], "availabilityCondition": "not (answered or credit=1)", "penalty": "", "penaltyAmount": 0, "showPenaltyHint": true, "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, "displayAnswer": "", "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, "displayAnswer": "", "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, "showPenaltyHint": true, "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", "showPenaltyHint": true, "lockAfterLeaving": false}, {"label": "Is the coin biased?", "rawLabel": "", "otherPart": 7, "variableReplacements": [], "availabilityCondition": "answered", "penalty": "", "penaltyAmount": 0, "showPenaltyHint": true, "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, "displayAnswer": "", "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", "showPenaltyHint": true, "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, "displayAnswer": "", "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"}, {"name": "Decide if the coin is biased", "limit": "5"}, {"name": "Design the experiment", "limit": "2"}, {"name": "Enter data", "limit": "1"}], "penalties": [{"name": "Showed frequencies of heads and tails", "limit": "1"}, {"name": "Hint about critical likelihood", "limit": "1"}], "objectiveVisibility": "when-active", "penaltyVisibility": "when-active", "type": "question"}, {"name": "Invent your own question: binary encoding", "extensions": [], "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": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "tags": [], "metadata": {"description": "

Guides the student through the process of writing an integer in binary. They can pick any number they like, then choose from a selection of methods, or just do their own method and have the answer checked.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "", "advice": "", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"n": {"name": "n", "group": "Ungrouped variables", "definition": "3435", "description": "", "templateType": "anything", "can_override": false}, "largest_power_of_2": {"name": "largest_power_of_2", "group": "Ungrouped variables", "definition": "2^floor(log(working_n,2))", "description": "

The largest power of 2 less than or equal to n.

", "templateType": "anything", "can_override": false}, "powers": {"name": "powers", "group": "Ungrouped variables", "definition": "[]", "description": "", "templateType": "anything", "can_override": false}, "subtracting_powers_description": {"name": "subtracting_powers_description", "group": "Ungrouped variables", "definition": "latex(if(powers=[],\n \"{n}\",\n join(map(\"2^{p}\",p,powers), \" + \")+if(working_n>0, \" + {working_n}\", \"\")\n))", "description": "

The description of the current state of the process of subtracting the largest possible power of 2.

", "templateType": "anything", "can_override": false}, "working_n": {"name": "working_n", "group": "Ungrouped variables", "definition": "n", "description": "

The value that the student is working with at the current step.

", "templateType": "anything", "can_override": false}, "binary_encoding": {"name": "binary_encoding", "group": "Ungrouped variables", "definition": "tobinary(int(n))", "description": "", "templateType": "anything", "can_override": false}, "is_odd": {"name": "is_odd", "group": "Ungrouped variables", "definition": "mod(working_n,2)=1", "description": "

Is the working value odd?

", "templateType": "anything", "can_override": false}, "dividing_description": {"name": "dividing_description", "group": "Ungrouped variables", "definition": "latex(foldl(if(odd, \"({s}-1)/2\", \"{s}/2\"), s, odd, string(n), odds))", "description": "", "templateType": "anything", "can_override": false}, "odds": {"name": "odds", "group": "Ungrouped variables", "definition": "[]", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["n", "working_n", "largest_power_of_2", "powers", "subtracting_powers_description", "binary_encoding", "is_odd", "odds", "dividing_description"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": true, "customName": "Pick a number", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Next step", "rawLabel": "Next step", "otherPart": 1, "variableReplacements": [{"variable": "n", "definition": "interpreted_answer"}], "availabilityCondition": "answered", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Pick a positive integer. Any positive integer.

", "minValue": "1", "maxValue": "infinity", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "dp", "precision": 0, "precisionPartialCredit": 0, "precisionMessage": "You must write a whole number.", "strictPrecision": true, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "information", "useCustomName": true, "customName": "Choose your path", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Repeatedly subtract the largest possible power of 2", "rawLabel": "Repeatedly subtract the largest possible power of 2", "otherPart": 2, "variableReplacements": [], "availabilityCondition": "", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}, {"label": "Repeatedly divide by 2, subtracting 1 if odd", "rawLabel": "Repeatedly divide by 2, subtracting 1 if odd", "otherPart": 6, "variableReplacements": [], "availabilityCondition": "", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}, {"label": "I'll use my own method", "rawLabel": "I'll use my own method", "otherPart": 10, "variableReplacements": [], "availabilityCondition": "", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

You chose $n = \\var{n}$.

\n

Your task is to write $n$ in binary.

\n

How would you like to do that?

"}, {"type": "numberentry", "useCustomName": true, "customName": "What's the largest power of 2?", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Next step", "rawLabel": "Next step", "otherPart": 2, "variableReplacements": [{"variable": "working_n", "definition": "working_n - interpreted_answer"}, {"variable": "powers", "definition": "powers + [round(log(interpreted_answer,2))]"}], "availabilityCondition": "answered and credit=1 and largest_power_of_2 < working_n", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}, {"label": "Next step", "rawLabel": "Next step", "otherPart": 3, "variableReplacements": [{"variable": "working_n", "definition": "working_n - interpreted_answer"}, {"variable": "powers", "definition": "powers + [log(interpreted_answer,2)]"}], "availabilityCondition": "answered and credit=1 and largest_power_of_2 = working_n", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\var{n} = \\var{subtracting_powers_description}$

\n

What's the largest power of 2 less than or equal to $\\var{working_n}$?

", "minValue": "largest_power_of_2", "maxValue": "largest_power_of_2", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "information", "useCustomName": true, "customName": "Finished subtracting powers of 2", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Write the binary encoding", "rawLabel": "Write the binary encoding", "otherPart": 4, "variableReplacements": [], "availabilityCondition": "", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\var{n} = \\var{subtracting_powers_description}$.

"}, {"type": "patternmatch", "useCustomName": true, "customName": "Write the binary encoding - subtracted powers", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "I'd like a hint please", "rawLabel": "I'd like a hint please", "otherPart": 5, "variableReplacements": [], "availabilityCondition": "not (answered and credit=1)", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Write the binary encoding", "prompt": "

$\\var{n} = \\var{subtracting_powers_description}$.

\n

Now write the binary representation of $\\var{n}$.

\n

", "answer": "{binary_encoding}", "displayAnswer": "", "matchMode": "exact"}, {"type": "information", "useCustomName": true, "customName": "Binary encoding hint - subtracted powers", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": true, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

For each power of 2, from the largest one you wrote down to $2^0 = 1$, write a $1$ if that power is in your list, or a $0$ if it isn't.

"}, {"type": "yes-no", "useCustomName": true, "customName": "Subtract 1 if odd", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Subtract 1 and divide by 2", "rawLabel": "Subtract 1 and divide by 2", "otherPart": 6, "variableReplacements": [{"variable": "working_n", "definition": "(working_n-1)/2"}, {"variable": "odds", "definition": "odds+[1]"}], "availabilityCondition": "answered and credit=1 and is_odd and working_n > 1", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}, {"label": "Divide by 2", "rawLabel": "Divide by 2", "otherPart": 6, "variableReplacements": [{"variable": "working_n", "definition": "working_n/2"}, {"variable": "odds", "definition": "odds+[0]"}], "availabilityCondition": "answered and credit=1 and not is_odd and working_n > 1", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}, {"label": "Next step", "rawLabel": "Next step", "otherPart": 7, "variableReplacements": [{"variable": "working_n", "definition": "0"}, {"variable": "odds", "definition": "odds+[if(is_odd,1,0)]"}], "availabilityCondition": "answered and credit=1 and working_n in [0,1]", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\var{working_n} = \\var{dividing_description}$

\n

Is $\\var{working_n}$ odd?

", "settings": {"correct_answer_expr": "is_odd"}}, {"type": "information", "useCustomName": true, "customName": "Finished dividing by 2", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Write the binary encoding", "rawLabel": "Write the binary encoding", "otherPart": 8, "variableReplacements": [], "availabilityCondition": "", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\var{working_n} = \\var{dividing_description}$

"}, {"type": "patternmatch", "useCustomName": true, "customName": "Write the binary encoding - dividing by 2", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "I'd like a hint, please", "rawLabel": "I'd like a hint, please", "otherPart": 9, "variableReplacements": [], "availabilityCondition": "not (answered and credit=1)", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Write the binary encoding", "prompt": "

$0 = \\var{dividing_description}$.

\n

Now write the binary representation of $\\var{n}$.

\n

", "answer": "{binary_encoding}", "displayAnswer": "", "matchMode": "exact"}, {"type": "information", "useCustomName": true, "customName": "Binary encoding hint - dividing by 2", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": true, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$0 = \\var{dividing_description}$

\n

Adding a 0 to the end of the binary representation of $n$ gives you the binary representation of $2n$.

\n

You can use this to build up the binary representation of $\\var{n}$ while unravelling the expression above.

\n

So, starting with an empty string, read the expression from right to left, adding a $0$ when you see $/2$, or changing the rightmost $0$ to $1$ when you see $-1$.

"}, {"type": "patternmatch", "useCustomName": true, "customName": "Write the binary encoding - own method", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "I'd like a hint, please", "rawLabel": "I'd like a hint, please", "otherPart": "", "variableReplacements": [], "availabilityCondition": "not (answered and credit=1)", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Write the binary encoding", "prompt": "

Write the binary representation of $\\var{n}$.

", "answer": "{binary_encoding}", "displayAnswer": "", "matchMode": "exact"}], "partsMode": "explore", "maxMarks": 0, "objectives": [{"name": "Write the binary encoding", "limit": 1}], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "JSXGraph interactive Venn diagram", "extensions": ["jsxgraph"], "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 a few ways of interacting with a Venn diagram drawn using JSXGraph.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "", "advice": "", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"ns": {"name": "ns", "group": "Ungrouped variables", "definition": "shuffle(-7..7 except 0)[0..6]", "description": "", "templateType": "anything", "can_override": false}, "venn_diagram_many_solo": {"name": "venn_diagram_many_solo", "group": "Ungrouped variables", "definition": "jxg_add_objects(venn_diagram_2(\"Positive\",\"Even\"),\n map(['point',[i-len(ns)/2,3],[\"id\":'n_{i}',\"size\":5,name:\"{ns[i]}\"]],i,0..len(ns)-1)\n)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["ns", "venn_diagram_many_solo"], "variable_groups": [{"name": "One point", "variables": []}], "functions": {"venn_diagram_2": {"parameters": [["set1_name", "string"], ["set2_name", "string"]], "type": "jsxgraphboard", "language": "jme", "definition": "jessiecode(500,400,[-5,4,5,-4],\"\"\"\n r = 2.5;\n circle([-1.5,0],r) <>;\n circle([1.5,0],r) <>;\n text(-2.5,-r-0.5,\"{set1_name}\") <>;\n text(2.5,-r-0.5,\"{set2_name}\") <>;\n\"\"\",\n [\"grid\": false, \"axis\": false]\n)"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "extension", "useCustomName": true, "customName": "Several points, without checkboxes", "marks": "6", "scripts": {}, "customMarkingAlgorithm": "diagram: venn_diagram_many_solo\n\npoints (The points to move):\n map(diagram[\"n_{i}\"],i,0..len(ns)-1)\n\ncoords (The coordinates of each point): \n map(jxg_position(p),p,points)\n\ncorrect_memberships:\n map(\n [n>0, mod(n,2)=0],\n n,\n ns\n )\n\nstudent_memberships (For each point, is it inside each of the subset circles?):\n map(\n [jxg_has_point(diagram[\"c_1\"],c), jxg_has_point(diagram[\"c_2\"],c)],\n c,\n coords\n )\n\ncredit_per: 1/(2*len(ns))\n\nmark_points:\n map(\n let(\n [c_1,c_2], correct, \n [s_1,s_2], student,\n if(c_1 = s_1,\n add_credit(credit_per,if(c_1, \"{n} is positive.\", \"{n} is not positive.\"))\n ,\n negative_feedback(\n if(s_1, \n \"You said that {n} is positive, but it is not.\"\n , \"You said that {n} is not positive, but it is.\"\n )\n )\n )\n if(c_2 = s_2,\n add_credit(credit_per,if(c_2, \"{n} is even.\", \"{n} is not even.\"))\n ,\n negative_feedback(\n if(s_2, \n \"You said that {n} is even, but it is not.\"\n , \"You said that {n} is not even, but it is.\"\n )\n )\n )\n ),\n [correct,student,n],\n zip(correct_memberships, student_memberships, ns)\n )\n\nmark:\n apply(mark_points)\n\ninterpreted_answer:\n student_memberships", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The Venn diagram below represents the set of integers, with the positive and even numbers as subsets.

\n

For each of the numbers {join(ns,', ')}, decide if it is positive and if it is even. Move the points representing the numbers to the appropriate positions on the diagram.

\n

{venn_diagram_many_solo}

"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}]}], "allowPrinting": true, "navigation": {"allowregen": true, "reverse": true, "browse": true, "allowsteps": true, "showfrontpage": true, "showresultspage": "oncompletion", "navigatemode": "sequence", "onleave": {"action": "none", "message": ""}, "preventleave": true, "startpassword": ""}, "timing": {"allowPause": true, "timeout": {"action": "none", "message": ""}, "timedwarning": {"action": "none", "message": ""}}, "feedback": {"showactualmark": true, "showtotalmark": true, "showanswerstate": true, "allowrevealanswer": true, "advicethreshold": 0, "intro": "", "reviewshowscore": true, "reviewshowfeedback": true, "reviewshowexpectedanswer": true, "reviewshowadvice": 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": ["eukleides", "jsxgraph", "permutations", "stats"], "custom_part_types": [{"source": {"pk": 133, "author": {"name": "Christian Lawson-Perfect", "pk": 7}, "edit_page": "/part_type/133/edit"}, "name": "Write an equivalent word", "short_name": "write-a-word-producing-a-given-permutation", "description": "

The student must write a word on the given generators which is equivalent to the given word.

\n

The generators are given as a dictionary mapping letters to permutations.

", "help_url": "", "input_widget": "string", "input_options": {"correctAnswer": "settings[\"correctWord\"]", "hint": {"static": true, "value": ""}, "allowEmpty": {"static": true, "value": false}}, "can_be_gap": true, "can_be_step": true, "marking_script": "generator_dict:\nsettings[\"generators\"]\n\nstudent_letters:\nsplit(replace_regex(\"[^a-z]\",\"\",lower(studentanswer),\"g\"),\"\")\n\nvalid_letters:\nassert(all(map(x in generator_dict,x,student_letters)),\n warn(\"Your word is invalid. You must only use letters corresponding to generators.\");\n fail(\"Your word is invalid. You must only use letters corresponding to generators.\")\n)\n\nstudent_word:\nmap(generator_dict[x],x,student_letters)\n\nstudent_perm:\niterate_until([p*word[-1],word[0..-1]],[p,word],[permutation(\"\"),student_word],len(word)=0)[-1][0]\n\ncorrect_letters:\nsplit(replace_regex(\"[^a-z]\",\"\",lower(settings[\"correctWord\"]),\"g\"),\"\")\n\ncorrect_word:\nmap(generator_dict[x],x,correct_letters)\n\ncorrect_perm:\niterate_until([p*word[-1],word[0..-1]],[p,word],[permutation(\"\"),correct_word],len(word)=0)[-1][0]\n\nperm_is_correct:\nif(student_perm=correct_perm,\n correct()\n, incorrect(\"Your answer is incorrect: your word produced the ordering \"+join(list(student_perm),' ')+\".\")\n)\n\nmark:\napply(valid_letters);\napply(perm_is_correct)\n\ninterpreted_answer:\nstudent_letters", "marking_notes": [{"name": "generator_dict", "description": "", "definition": "settings[\"generators\"]"}, {"name": "student_letters", "description": "

The letters in the student's word. Any non-letter characters are removed.

", "definition": "split(replace_regex(\"[^a-z]\",\"\",lower(studentanswer),\"g\"),\"\")"}, {"name": "valid_letters", "description": "

Are all of the letters in the student's word in the generator dictionary? Fail if not.

", "definition": "assert(all(map(x in generator_dict,x,student_letters)),\n warn(\"Your word is invalid. You must only use letters corresponding to generators.\");\n fail(\"Your word is invalid. You must only use letters corresponding to generators.\")\n)"}, {"name": "student_word", "description": "", "definition": "map(generator_dict[x],x,student_letters)"}, {"name": "student_perm", "description": "

The permutation produced by the student's word.

", "definition": "iterate_until([p*word[-1],word[0..-1]],[p,word],[permutation(\"\"),student_word],len(word)=0)[-1][0]"}, {"name": "correct_letters", "description": "", "definition": "split(replace_regex(\"[^a-z]\",\"\",lower(settings[\"correctWord\"]),\"g\"),\"\")"}, {"name": "correct_word", "description": "", "definition": "map(generator_dict[x],x,correct_letters)"}, {"name": "correct_perm", "description": "", "definition": "iterate_until([p*word[-1],word[0..-1]],[p,word],[permutation(\"\"),correct_word],len(word)=0)[-1][0]"}, {"name": "perm_is_correct", "description": "", "definition": "if(student_perm=correct_perm,\n correct()\n, incorrect(\"Your answer is incorrect: your word produced the ordering \"+join(list(student_perm),' ')+\".\")\n)"}, {"name": "mark", "description": "This is the main marking note. It should award credit and provide feedback based on the student's answer.", "definition": "apply(valid_letters);\napply(perm_is_correct)"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "student_letters"}], "settings": [{"name": "generators", "label": "Generators", "help_url": "", "hint": "A dictionary mapping letters to elements of the group.", "input_type": "code", "default_value": "", "evaluate": true}, {"name": "correctWord", "label": "Correct word", "help_url": "", "hint": "The word that the student must produce.", "input_type": "string", "default_value": "", "subvars": true}], "public_availability": "restricted", "published": false, "extensions": ["permutations"]}, {"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": []}