// Numbas version: exam_results_page_options {"name": "One gap fills in another", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {}, "name": "One gap fills in another", "tags": [], "preamble": {"css": ".hidden {\n/* display: none; */\n}", "js": "question.signals.on('HTMLAttached',function() {\n \n // part a\n $('#thing').on('change keyup',function() {\n // get the answer from the input box\n var ans = $(this).val();\n \n // change it a bit\n ans += '+x';\n \n // set the answer to gap 0\n question.parts[0].gaps[0].display.studentAnswer(ans);\n });\n \n // part b\n ko.computed(function() {\n var ans = question.parts[1].gaps[0].display.studentAnswer();\n \n ans += '+x';\n \n question.parts[1].gaps[1].display.studentAnswer(ans);\n });\n})"}, "advice": "", "rulesets": {}, "parts": [{"type": "gapfill", "gaps": [{"expectedvariablenames": [], "checkingaccuracy": 0.001, "type": "jme", "showpreview": true, "vsetrangepoints": 5.0, "checkingtype": "absdiff", "marks": 0.0, "answer": "x", "checkvariablenames": false, "vsetrange": [0.0, 1.0]}, {"expectedvariablenames": [], "checkingaccuracy": 0.001, "type": "jme", "showpreview": false, "vsetrangepoints": 5.0, "checkingtype": "absdiff", "marks": 1.0, "answer": "x+x", "checkvariablenames": false, "vsetrange": [0.0, 1.0]}], "prompt": "

This part uses an HTML input box created in the prompt.

\n

\n

[[0]]

", "marks": 0.0}, {"type": "gapfill", "gaps": [{"expectedvariablenames": [], "checkingaccuracy": 0.001, "type": "jme", "showpreview": true, "vsetrangepoints": 5.0, "checkingtype": "absdiff", "marks": 0.0, "answer": "x", "checkvariablenames": false, "vsetrange": [0.0, 1.0]}, {"expectedvariablenames": [], "checkingaccuracy": 0.001, "type": "jme", "showpreview": true, "vsetrangepoints": 5.0, "checkingtype": "absdiff", "marks": 1.0, "answer": "x+x", "checkvariablenames": false, "vsetrange": [0.0, 1.0]}], "prompt": "

This part uses the answer from one gap to fill in another

\n

[[0]]

\n

[[1]]

", "marks": 0.0}], "extensions": [], "statement": "

Add some CSS to set the class \"hidden\" to display:none;

", "variable_groups": [], "progress": "in-progress", "type": "question", "variables": {}, "metadata": {"notes": "", "description": "", "licence": "Creative Commons Attribution 4.0 International"}, "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}