// Numbas version: finer_feedback_settings
{"name": "Student can choose names of constants of integration in a 2nd order ODE solution", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Student can choose names of constants of integration in a 2nd order ODE solution", "tags": [], "metadata": {"description": "A custom marking algorithm picks out the names of the constants of integration that the student has used for the $\\cos$ and $\\sin$ terms in their answer, and replaces them with $A$ and $B$ respectively, before comparing with the correct answer. This way, the student is free to choose the names for their constants of integration.
", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "", "advice": "", "rulesets": {}, "extensions": [], "variables": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "cos_constant (The name of the constant the student has used for the cos term):\n let(m,match(base_studentExpr,\"($v;constant * cos(?) * ?`*) + ?`*\"),\n string(if(m[\"match\"],m[\"groups\"][\"constant\"],name(\"A\")))\n )\n\nsin_constant (The name of the constant the student has used for the cos term):\n let(m,match(base_studentExpr,\"($v;constant * sin(?) * ?`*) + ?`*\"),\n string(if(m[\"match\"],m[\"groups\"][\"constant\"],name(\"B\")))\n )\n\nstudentExpr (The student's expression, rewritten to use our constants for the cos and sin terms):\n substitute(dict([[cos_constant,name(\"A\")], [sin_constant,name(\"B\")]]),base_studentExpr)", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "a*e^2*cos(x) + b*sin(x)*e^2", "answer": {"valid": true, "value": "a*e^2*cos(x)+b*sin(x)*e^2"}, "notes": [{"name": "studentexpr", "expected": {"value": "A*e^2*cos(x) + B*sin(x)*e^2", "messages": [], "warnings": [], "error": "", "valid": true, "credit": 0}}, {"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is numerically correct.\n\nYou were awarded 1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "a*sin(x)*e^2 + b*cos(x)*e^2", "answer": {"valid": true, "value": "a*sin(x)*e^2 + b*cos(x)*e^2"}, "notes": [{"name": "studentexpr", "expected": {"value": "B*sin(x)*e^2 + A*cos(x)*e^2", "messages": [], "warnings": [], "error": "", "valid": true, "credit": 0}}, {"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is numerically correct.\n\nYou were awarded 1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "a*cos(x)*e^2 + b*sin(x)*e^2", "answer": {"valid": true, "value": "a*cos(x)*e^2 + a*sin(x)*e^2"}, "notes": [{"name": "studentexpr", "expected": {"value": "B*cos(x)*e^2 + B*sin(x)*e^2", "messages": [], "warnings": [], "error": "", "valid": true, "credit": 0}}, {"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is incorrect."], "warnings": [], "error": "", "valid": true, "credit": 0}}]}], "prompt": "
The answer is $A e^2 \\cos(x) + B e^2 \\sin(x)$
", "answer": "A*e^2*cos(x) + B*e^2*sin(x)", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "valuegenerators": [{"name": "a", "value": ""}, {"name": "b", "value": ""}, {"name": "x", "value": ""}]}], "type": "question", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "resources": []}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}