{ "source": { "author": { "name": "Christian Lawson-Perfect" } }, "name": "Give a numerical input for an expression", "short_name": "give-a-numerical-input-for-an-expression", "description": "

The student gives a point $x$ at which to evaluate a given function $f$. The answer is correct if $f(x)$ is the expected value.

", "help_url": "", "input_widget": "number", "input_options": { "correctAnswer": "settings[\"correctAnswer\"]", "hint": { "static": true, "value": "" }, "allowedNotationStyles": { "static": true, "value": [ "plain", "en", "si-en" ] }, "allowFractions": { "static": true, "value": true } }, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\nif(equal,\n correct()\n,\n incorrect(settings[\"student_value_description\"]+\" $\"+student_value+\"$.\")\n)\n\ninterpreted_answer:\nstudentAnswer\n\nstudent_value:\neval(settings[\"expression\"],[\"x\":studentAnswer])\n\nequal:\nwithintolerance(student_value,settings[\"expected_value\"],0.00001)", "marking_notes": [ { "name": "mark", "description": "This is the main marking note. It should award credit and provide feedback based on the student's answer.", "definition": "if(equal,\n correct()\n,\n incorrect(settings[\"student_value_description\"]+\" $\"+student_value+\"$.\")\n)" }, { "name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "studentAnswer" }, { "name": "student_value", "description": "", "definition": "eval(settings[\"expression\"],[\"x\":studentAnswer])" }, { "name": "equal", "description": "", "definition": "withintolerance(student_value,settings[\"expected_value\"],0.00001)" } ], "settings": [ { "name": "expected_value", "label": "Expected value", "help_url": "", "hint": "The value that the function should take at the given point.", "input_type": "code", "default_value": "", "evaluate": true }, { "name": "correctAnswer", "label": "Correct answer", "help_url": "", "hint": "The value that the student should write.", "input_type": "string", "default_value": "", "subvars": true }, { "name": "student_value_description", "label": "Description of the student's value", "help_url": "", "hint": "", "input_type": "string", "default_value": "The value at your point is", "subvars": true }, { "name": "expression", "label": "Function to evaluate", "help_url": "", "hint": "The function that will be applied to the student's number.
The student's number will be substituted for $x$ in this expression.", "input_type": "mathematical_expression", "default_value": "", "subvars": true } ], "public_availability": "always", "published": true, "extensions": [] }