// Numbas version: exam_results_page_options {"name": "Josh's copy of Catch malrules", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Identify when the student gives an expected incorrect answer, and give appropriate feedback as well as partial marks.

"}, "preamble": {"css": "", "js": ""}, "extensions": [], "ungrouped_variables": ["test"], "rulesets": {}, "statement": "

This question catches some expected incorrect answers and gives appropriate feedback, along with partial marks.

", "variable_groups": [], "tags": [], "functions": {}, "name": "Josh's copy of Catch malrules", "advice": "", "variablesTest": {"condition": "", "maxRuns": 100}, "parts": [{"prompt": "

Differentiate $f(x) = \\cos(2x)$

\n

$\\var{test}$

", "variableReplacementStrategy": "originalfirst", "type": "jme", "showPreview": true, "showCorrectAnswer": true, "customName": "", "customMarkingAlgorithm": "malrules:\n [\n [\"2sin(2x)\", \"Did you forget a minus sign?\"],\n [\"-sin(2x)\", \"You might have forgotten to apply the chain rule.\"],\n [\"2cos(2x)\", \"It looks like you forgot to differentiate $\\\\cos$.\"],\n [\"1/2sin(2x)\", \"It looks like you integrated instead of differentiating.\"]\n ]\n\n\nparsed_malrules: \n map(\n [\"expr\":parse(x[0]),\"feedback\":x[1]],\n x,\n malrules\n )\n\nagree_malrules (Do the student's answer and the expected answer agree on each of the sets of variable values?):\n map(\n len(filter(not x ,x,map(\n try(\n resultsEqual(unset(question_definitions,eval(studentexpr,vars)),unset(question_definitions,eval(malrule[\"expr\"],vars)),settings[\"checkingType\"],settings[\"checkingAccuracy\"]),\n message,\n false\n ),\n vars,\n vset\n )))