// Numbas version: exam_results_page_options {"name": " Tick box for \"this is impossible\" with matrix entry", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": " Tick box for \"this is impossible\" with matrix entry", "tags": [], "metadata": {"description": "

The student is asked to write a matrix with a certain property, or tick a box labelled \"this is impossible\" if it can't be done.

\n

A custom marking algorithm on the gap-fill part first checks if the student ticked the box. If they did, their answer is marked correct if it really is impossible. If they didn't tick it, their matrix is checked against the required property.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "", "advice": "", "rulesets": {}, "extensions": [], "variables": {"is_invertible": {"name": "is_invertible", "group": "Ungrouped variables", "definition": "random(true,false)", "description": "

Should the square of the student's number be positive? If false, it should be negative.

", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["is_invertible"], "variable_groups": [], "functions": {"emptymatrix": {"parameters": [["m", "number"], ["n", "number"]], "type": "anything", "language": "jme", "definition": "repeat(repeat(safe(\"\"),n),m)"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "student_impossible (Did the student tick \"This is impossible\"?): studentanswer[1][0][0]\n\nmark_matrix: \n assert(matrix_valid, \n fail(\"You must either enter a valid matrix or tick 'This is impossible'.\")\n );\n correctif(if(is_invertible, marked_matrix[\"credit\"]=1, false))\n\n\nmarked_matrix:\n mark_part(gaps[0][\"path\"],studentAnswer[0])\n\n\nstudentmatrixempty:\n studentanswer[0]=emptymatrix(marked_matrix[\"values\"][\"rows\"],marked_matrix[\"values\"][\"cols\"])\n\nmatrix_valid:\n marked_matrix[\"valid\"] and not(studentmatrixempty)\n\nonly_tick:\n student_impossible and studentmatrixempty\n\ntick_and_matrix_feedback:\n assert(only_tick,\n fail(\"If you tick 'This is impossible', leave the matrix entry blank.\")\n )\n\nmark:\n if(student_impossible,\n apply(tick_and_matrix_feedback);\n correctif(not is_invertible and studentmatrixempty)\n ,\n apply(mark_matrix)\n )\n\ninterpreted_answer: studentanswer", "extendBaseMarkingAlgorithm": false, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Write a matrix whose inverse is \\(\\var{if(is_invertible,id(2),matrix([0,1]))}\\).

\n

Or if it can't be done, tick \"this is impossible\" and leave the box blank.

\n

\n

[[0]]

\n

[[1]]

", "gaps": [{"type": "matrix", "useCustomName": true, "customName": "Matrix", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "id(2)", "correctAnswerFractions": false, "numRows": 1, "numColumns": 1, "allowResize": true, "tolerance": 0, "markPerCell": false, "allowFractions": true, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}, {"type": "m_n_2", "useCustomName": true, "customName": "Is it impossible?", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "checkbox", "displayColumns": 0, "minAnswers": 0, "maxAnswers": 0, "warningType": "none", "showCellAnswerState": true, "choices": ["This is impossible."], "matrix": [0], "distractors": [""]}], "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/"}, {"name": "Julia Goedecke", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/5121/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Julia Goedecke", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/5121/"}]}