// Numbas version: exam_results_page_options {"name": "Replace a text input with a textarea tag", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Replace a text input with a textarea tag", "tags": [], "metadata": {"description": "

Give the student a larger area to write some free-form text, which isn't marked.

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

Use completing the square to factorise $x^2-4x-5$ .

", "advice": "", "rulesets": {}, "extensions": [], "variables": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [], "functions": {}, "preamble": {"js": "// replace the input for a \"match text pattern\" part with a textarea\n// call this from the \"when the part is created\" script.\nquestion.replaceWithTextArea = function(part) {\n question.onHTMLAttached(function() {\n var input = $(question.display.html).find('.part').filter(function(){ \n return $(this).attr('data-bind').indexOf(\"getPart('\"+part.path+\"')\")>=0;\n });\n $(input).css('display','none');\n var textarea = $('');\n $(input).after(textarea);\n $(textarea).val(part.display.studentAnswer());\n $(textarea).on('input',function() {\n part.display.studentAnswer($(this).val());\n });\n });\n}", "css": ".long-form-text {\n width: 100%;\n height: 8em;\n}"}, "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": "

Show your steps here:

\n

[[0]]

\n

The factorized expression is: [[1]]

", "gaps": [{"type": "patternmatch", "useCustomName": true, "customName": "Steps", "marks": "0", "scripts": {"constructor": {"script": "question.replaceWithTextArea(this);", "order": "after"}}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "", "displayAnswer": "", "matchMode": "regex"}, {"type": "jme", "useCustomName": true, "customName": "Factorised expression", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "(x-5)*(x+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, "mustmatchpattern": {"pattern": "?*?", "partialCredit": 0, "message": "", "nameToCompare": ""}, "valuegenerators": [{"name": "x", "value": ""}]}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "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/"}]}