// Numbas version: exam_results_page_options {"name": "Ben's copy of Custom marking of a matrix entry part", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"preamble": {"css": "", "js": ""}, "extensions": [], "name": "Ben's copy of Custom marking of a matrix entry part", "statement": "", "rulesets": {}, "advice": "", "tags": [], "ungrouped_variables": [], "variables": {}, "variablesTest": {"maxRuns": 100, "condition": ""}, "functions": {}, "parts": [{"scripts": {"mark": {"script": "// student's answer is held in this.studentAnswer\n// it's a 2d array of the strings the student wrote\n// you have to parse each cell as a number.\n\n\n// this script doesn't really do any marking - it just looks at the bottom-right cell of the student's answer\n\nvar cell = Numbas.util.parseNumber(this.studentAnswer[1][1]);\n\nif(Numbas.util.isNumber(cell)) {\n this.markingComment(\"The bottom right cell is \"+cell);\n this.answered = true;\n this.setCredit(1);\n} else {\n this.invalidCell = true; // used by the validation script so it gives the right error message\n this.answered = false;\n this.setCredit(0,\"The bottom right cell is not a number!\");\n}", "order": "instead"}}, "numColumns": "2", "correctAnswerFractions": false, "type": "matrix", "allowResize": false, "tolerance": 0, "marks": "2", "variableReplacements": [], "prompt": "

Write a $2 \\times 2$ matrix. The feedback will show the bottom-right value.

", "allowFractions": false, "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "numRows": "2", "correctAnswer": "id(2)", "markPerCell": false}], "metadata": {"description": "", "licence": "Creative Commons Attribution 4.0 International"}, "variable_groups": [], "type": "question", "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}]}]}], "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}]}