// Numbas version: exam_results_page_options {"name": "JSXGraph MCQ Example 2", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "JSXGraph MCQ Example 2", "tags": [], "metadata": {"description": "

Small demo using the JME implementation of JSXGraph inline in a multiple choice question. This version uses a JME variable to store the expressions and then calls a function wherever a plot is required.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "", "advice": "

The gradient is {a}.

\n

The y-intercept is {b}.

\n

Therefore the correct graph is

\n

{jsxgraph( 300,300, [-5, 5, 5, -5],[\"f\": ['functiongraph',[expression(\"a*x+b\")]] ])}

", "rulesets": {}, "extensions": ["jsxgraph"], "variables": {"a": {"name": "a", "group": "Equation variables", "definition": "random(-3..3 except 0)", "description": "

Variable in the expression given to the student (and the gradient of the line)

", "templateType": "anything"}, "b": {"name": "b", "group": "Equation variables", "definition": "random(-3..3 except 0)", "description": "

Variable in the expression given to the student (and the intercept of the line)

", "templateType": "anything"}, "correct_expressions": {"name": "correct_expressions", "group": "Expressions - edit here", "definition": "[\"{a}*x+{b}\"]", "description": "

A list of correct expressions.

", "templateType": "anything"}, "incorrect_expressions": {"name": "incorrect_expressions", "group": "Expressions - edit here", "definition": "[\"{a}*x-{b}\",\"-{a}*x+{b}\",\"{a}*x\",\"-{a}*x-{b}\"]", "description": "

A list of incorrect expressions. The number used in the question is defined by num_incorrect

", "templateType": "anything"}, "expressions": {"name": "expressions", "group": "Admin", "definition": "map([x,true],x,correct_expressions) + map([x,false],x,incorrect_expressions_shown)", "description": "

Collects together the correct and incorrect expressions.

", "templateType": "anything"}, "marking_matrix": {"name": "marking_matrix", "group": "Admin", "definition": "map(if(correct,1,0),[text,correct],shown_expressions)+[0]", "description": "

The marking matrix - the additional element +[0] is added to account for the additional 'sticky' option given at the end of the choices.

", "templateType": "anything"}, "shown_expressions": {"name": "shown_expressions", "group": "Admin", "definition": "shuffle(expressions)", "description": "

Shuffles exressions so that the position of the correct answer varies

", "templateType": "anything"}, "choices": {"name": "choices", "group": "Admin", "definition": "map(text,[text,correct],shown_expressions)", "description": "

A list of choices to give to the student. The expression is turned into a jsxgraph plot using a function plot_expression defined in the Extensions & scripts tab

", "templateType": "anything"}, "num_incorrect": {"name": "num_incorrect", "group": "Expressions - edit here", "definition": "3", "description": "

The number of incorrect expressions to show

", "templateType": "anything"}, "incorrect_expressions_shown": {"name": "incorrect_expressions_shown", "group": "Admin", "definition": "shuffle(incorrect_expressions)[0..num_incorrect]", "description": "

A list of incorrect expressions to show to the student (shuffles and selects num_incorrect from the incorrect_expressions list)

", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [{"name": "Equation variables", "variables": ["a", "b"]}, {"name": "Expressions - edit here", "variables": ["correct_expressions", "incorrect_expressions", "num_incorrect"]}, {"name": "Admin", "variables": ["incorrect_expressions_shown", "expressions", "shown_expressions", "choices", "marking_matrix"]}], "functions": {"plot_expression": {"parameters": [["x", "string"]], "type": "html", "language": "jme", "definition": "jsxgraph(\n 250,250,\n [-5, 5, 5, -5],\n [\n \"f\": ['functiongraph',[x]]\n ]\n)"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Choose the graph of $\\simplify{{a}x+{b}}$ 

", "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": ["{plot_expression(choices[0])}", "{plot_expression(choices[1])}", "{plot_expression(choices[2])}", "{plot_expression(choices[3])}", "Another choice that always appears last"], "matrix": "marking_matrix"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}]}]}], "contributors": [{"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}]}