// Numbas version: finer_feedback_settings {"navigation": {"preventleave": false, "showresultspage": "oncompletion", "allowregen": true, "onleave": {"message": "", "action": "none"}, "reverse": true, "showfrontpage": true, "browse": true}, "showQuestionGroupNames": false, "metadata": {"description": "

Some questions to show off features of Numbas, linked from the Numbas homepage.

", "licence": "Creative Commons Attribution 4.0 International", "notes": ""}, "allQuestions": true, "percentPass": 0, "name": "CAA 2015 Numbas demo", "questions": [], "pickQuestions": 0, "timing": {"timedwarning": {"message": "", "action": "none"}, "allowPause": true, "timeout": {"message": "", "action": "none"}}, "feedback": {"allowrevealanswer": true, "showtotalmark": true, "showactualmark": true, "advicethreshold": 0, "showanswerstate": true, "enterreviewmodeimmediately": true, "showexpectedanswerswhen": "inreview", "showpartfeedbackmessageswhen": "always", "showactualmarkwhen": "always", "showtotalmarkwhen": "always", "showanswerstatewhen": "always", "showadvicewhen": "never"}, "question_groups": [{"questions": [{"name": "CAA 2015 Numbas demo intro", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "variablesTest": {"maxRuns": 100, "condition": ""}, "statement": "

This is Numbas.

\n

A Numbas test consists of one or more questions, each of which is split up into one or more parts.

\n

Questions are randomised according to a set of variables, defined by mathematical expressions.

", "advice": "", "type": "question", "parts": [], "preamble": {"css": "", "js": ""}, "variable_groups": [], "metadata": {"description": "", "licence": "Creative Commons Attribution 4.0 International", "notes": ""}, "ungrouped_variables": [], "tags": [], "showQuestionGroupNames": false, "functions": {}, "question_groups": [{"pickQuestions": 0, "pickingStrategy": "all-ordered", "questions": [], "name": ""}], "rulesets": {}, "variables": {}}, {"name": "Numbas demo: JME part", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}], "variables": {"num_terms": {"name": "num_terms", "description": "", "templateType": "anything", "definition": "3", "group": "Ungrouped variables"}, "powers": {"name": "powers", "description": "", "templateType": "anything", "definition": "sort(shuffle(list(0..8))[0..3])", "group": "Ungrouped variables"}, "coefficients": {"name": "coefficients", "description": "", "templateType": "anything", "definition": "repeat(random(-10..10 except 0),num_terms)", "group": "Ungrouped variables"}}, "parts": [{"unitTests": [], "marks": 0, "sortAnswers": false, "steps": [{"unitTests": [], "marks": 0, "variableReplacements": [], "showCorrectAnswer": true, "prompt": "

The derivative of $x^n$ is given by the following:

\n

\\[ \\frac{\\mathrm{d}}{\\mathrm{d}x}(x^n) = n \\times x^{n-1} \\]

\n

Enter the derivatives of each of the three terms in $f(x)$:

", "customMarkingAlgorithm": "", "type": "information", "scripts": {}, "customName": "", "useCustomName": false, "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst"}, {"valuegenerators": [{"name": "x", "value": ""}], "vsetRange": [0, 1], "unitTests": [], "checkingAccuracy": 0.001, "marks": 1, "vsetRangePoints": 5, "answer": "{coefficients[2]*powers[2]}*x^{powers[2]-1}", "variableReplacements": [], "type": "jme", "customName": "", "useCustomName": false, "checkVariableNames": false, "showFeedbackIcon": true, "showCorrectAnswer": true, "prompt": "

$\\frac{\\mathrm{d}}{\\mathrm{d}x}(\\simplify{{coefficients[2]}*x^{powers[2]}}) =$

", "failureRate": 1, "checkingType": "absdiff", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "showPreview": true, "variableReplacementStrategy": "originalfirst"}, {"valuegenerators": [{"name": "x", "value": ""}], "vsetRange": [0, 1], "unitTests": [], "checkingAccuracy": 0.001, "marks": 1, "vsetRangePoints": 5, "answer": "{coefficients[1]*powers[1]}*x^{powers[1]-1}", "variableReplacements": [], "type": "jme", "customName": "", "useCustomName": false, "checkVariableNames": false, "showFeedbackIcon": true, "showCorrectAnswer": true, "prompt": "

$\\frac{\\mathrm{d}}{\\mathrm{d}x}(\\simplify{{coefficients[1]}*x^{powers[1]}}) =$

", "failureRate": 1, "checkingType": "absdiff", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "showPreview": true, "variableReplacementStrategy": "originalfirst"}, {"valuegenerators": [{"name": "x", "value": ""}], "vsetRange": [0, 1], "unitTests": [], "checkingAccuracy": 0.001, "marks": 1, "vsetRangePoints": 5, "answer": "{coefficients[0]*powers[0]}*x^{powers[0]-1}", "variableReplacements": [], "type": "jme", "customName": "", "useCustomName": false, "checkVariableNames": false, "showFeedbackIcon": true, "showCorrectAnswer": true, "prompt": "

$\\frac{\\mathrm{d}}{\\mathrm{d}x}(\\simplify{{coefficients[0]}*x^{powers[0]}}) =$

", "failureRate": 1, "checkingType": "absdiff", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "showPreview": true, "variableReplacementStrategy": "originalfirst"}], "variableReplacements": [], "showCorrectAnswer": true, "prompt": "

Differentiate the following function.

\n

\\[ f(x) = \\simplify[all,!noLeadingMinus]{ {coefficients[2]}*x^{powers[2]} + {coefficients[1]}*x^{powers[1]} + {coefficients[0]}*x^{powers[0]} } \\]

\n

$\\frac{\\mathrm{d}f}{\\mathrm{d}x} = $ [[0]]

", "stepsPenalty": "1", "gaps": [{"valuegenerators": [{"name": "x", "value": ""}], "vsetRange": [0, 1], "unitTests": [], "checkingAccuracy": 0.001, "marks": "4", "vsetRangePoints": 5, "answer": "{coefficients[2]*powers[2]}*x^{powers[2]-1} + {coefficients[1]*powers[1]}*x^{powers[1]-1} + {coefficients[0]*powers[0]}*x^{powers[0]-1}", "showFeedbackIcon": true, "variableReplacements": [], "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "checkingType": "absdiff", "type": "jme", "scripts": {}, "customName": "", "useCustomName": false, "failureRate": 1, "checkVariableNames": false, "showPreview": true, "variableReplacementStrategy": "originalfirst"}], "customMarkingAlgorithm": "", "type": "gapfill", "scripts": {}, "customName": "", "useCustomName": false, "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst"}], "variable_groups": [], "tags": [], "ungrouped_variables": ["num_terms", "powers", "coefficients"], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"js": "", "css": ""}, "metadata": {"description": "", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

Numbas is really good at creating and marking randomised maths questions. In this question, you're given a random polynomial to differentiate.

\n

Notice how Numbas automatically simplifies the mathematical expressions so they look as if a human wrote them.

\n

See this question in the public editor

", "advice": "

The derivative of $x^n$ is given by the following:

\n

\\[ \\frac{\\mathrm{d}}{\\mathrm{d}x}(x^n) = n \\times x^{n-1} \\]

\n

We can compute the derivative of $f(x)$ by computing the derivatives of each of the three terms, and then adding them together.

\n

\\begin{align}
\\frac{\\mathrm{d}}{\\mathrm{d}x}(\\simplify{{coefficients[2]}*x^{powers[2]}}) &= \\simplify[basic]{{powers[2]}*{coefficients[2]}*x^({powers[2]}-1)} \\\\
&= \\simplify{{coefficients[2]*powers[2]}*x^{powers[2]-1}}
\\end{align}

\n

\\begin{align}
\\frac{\\mathrm{d}}{\\mathrm{d}x}(\\simplify{{coefficients[1]}*x^{powers[1]}}) &= \\simplify[basic]{{powers[1]}*{coefficients[1]}*x^({powers[1]}-1)} \\\\
&= \\simplify{{coefficients[1]*powers[1]}*x^{powers[1]-1}}
\\end{align}

\n

The derivative of a constant is $0$. So,

\n

\\[ \\frac{\\mathrm{d}}{\\mathrm{d}x}(\\var{coefficients[0]}) = 0 \\]

\n

\\begin{align}
\\frac{\\mathrm{d}}{\\mathrm{d}x}(\\simplify{{coefficients[0]}*x^{powers[0]}}) &= \\simplify[basic]{{powers[0]}*{coefficients[0]}*x^({powers[0]}-1)} \\\\
&= \\simplify{{coefficients[0]*powers[0]}*x^{powers[0]-1}}
\\end{align}

\n

Hence,

\n

\\[ \\frac{\\mathrm{d}f}{\\mathrm{d}x} = \\simplify{ {coefficients[2]*powers[2]}*x^{powers[2]-1} + {coefficients[1]*powers[1]}*x^{powers[1]-1} + {coefficients[0]*powers[0]}*x^{powers[0]-1} } \\]

", "functions": {}, "rulesets": {}, "type": "question"}, {"name": "Numbas demo: part types", "extensions": [], "custom_part_types": [{"source": {"pk": 1, "author": {"name": "Christian Lawson-Perfect", "pk": 7}, "edit_page": "/part_type/1/edit"}, "name": "Yes/no", "short_name": "yes-no", "description": "

The student is shown two radio choices: \"Yes\" and \"No\". One of them is correct.

", "help_url": "", "input_widget": "radios", "input_options": {"correctAnswer": "if(eval(settings[\"correct_answer_expr\"]), 0, 1)", "hint": {"static": true, "value": ""}, "choices": {"static": true, "value": ["Yes", "No"]}}, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\nif(studentanswer=correct_answer,\n correct(),\n incorrect()\n)\n\ninterpreted_answer:\nstudentAnswer=0\n\ncorrect_answer:\nif(eval(settings[\"correct_answer_expr\"]),0,1)", "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(studentanswer=correct_answer,\n correct(),\n incorrect()\n)"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "studentAnswer=0"}, {"name": "correct_answer", "description": "", "definition": "if(eval(settings[\"correct_answer_expr\"]),0,1)"}], "settings": [{"name": "correct_answer_expr", "label": "Is the answer \"Yes\"?", "help_url": "", "hint": "An expression which evaluates to true or false.", "input_type": "mathematical_expression", "default_value": "true", "subvars": false}], "public_availability": "always", "published": true, "extensions": []}], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "tags": [], "metadata": {"description": "

Showing off the part types.

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

Each part of a Numbas question asks the student to enter an answer, and is marked automatically. There are several part types, each with their own input methods and settings.

\n

See this question on the public editor.

", "advice": "", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"b": {"name": "b", "group": "Ungrouped variables", "definition": "random(1 .. 10#1)", "description": "", "templateType": "randrange", "can_override": false}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "random(1 .. 10#1)", "description": "", "templateType": "randrange", "can_override": false}, "d": {"name": "d", "group": "Ungrouped variables", "definition": "random(-10 .. 10#1)", "description": "", "templateType": "randrange", "can_override": false}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "random(-10..10 except 0)", "description": "", "templateType": "anything", "can_override": false}, "f": {"name": "f", "group": "Ungrouped variables", "definition": "random(-10 .. 10#1)", "description": "", "templateType": "randrange", "can_override": false}}, "variablesTest": {"condition": "a=4 and b=8", "maxRuns": "1000"}, "ungrouped_variables": ["a", "b", "c", "d", "f"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": true, "customName": "Number entry", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The number entry part asks the student to write a single number. It's marked correct if it's in the accepted range.

\n

I eat 5 apples per day. How many apples do I eat in a week?

", "minValue": "35", "maxValue": "35", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "jme", "useCustomName": true, "customName": "Mathematical expression", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The mathematical expression part type asks the student to write a mathematical expression as their answer. It's marked correct if it's equivalent to the expected answer.

\n

Differentiate the following function:

\n

\\[ f(x) = \\simplify[all,!noLeadingMinus]{{c}x^2+{d}x+{f}} \\]

", "answer": "{2*c}x+{d}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "x", "value": ""}]}, {"type": "matrix", "useCustomName": true, "customName": "Matrix entry", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The matrix entry part type asks the student to enter the elements of a matrix. It's marked correct if the student's matrix is equal to the expected matrix.

\n

Enter a $3 \\times 3$ identity matrix.

", "correctAnswer": "id(3)", "correctAnswerFractions": false, "numRows": "3", "numColumns": "3", "allowResize": true, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}, {"type": "patternmatch", "useCustomName": true, "customName": "Match text pattern", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The match text pattern part type asks the student to enter a short string of text. It's marked correct if it matches the pattern specified by the author.

\n

Write \"Numbas\".

", "answer": "Numbas", "displayAnswer": "Numbas", "caseSensitive": true, "partialCredit": "50", "matchMode": "exact"}, {"type": "1_n_2", "useCustomName": true, "customName": "Choose one from a list", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The choose one from a list part asks the student to choose one item from a list of options. Each option can award a different number of marks.

\n

Which fruit is biggest?

", "minMarks": 0, "maxMarks": 0, "shuffleChoices": true, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": ["Apple", "Strawberry", "Watermelon"], "matrix": [0, 0, "1"], "distractors": ["", "", ""]}, {"type": "m_n_2", "useCustomName": true, "customName": "Choose several from a list", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The choose several from a list part type asks the student to select one or more items from a list. Each option can award or subtract a different number of marks.

\n

Tick every prime number in the list below.

", "minMarks": 0, "maxMarks": 0, "shuffleChoices": true, "displayType": "checkbox", "displayColumns": "1", "minAnswers": 0, "maxAnswers": 0, "warningType": "none", "showCellAnswerState": true, "choices": ["13", "7", "2", "6", "9", "51"], "matrix": ["1", "1", "1", "-1", "-1", "-1"], "distractors": ["", "", "", "$6 = 2 \\times 3$.", "$9 = 3 \\times 3$.", "$51 = 3 \\times 17$."]}, {"type": "m_n_x", "useCustomName": true, "customName": "Match choices with answers", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The match choices with answers part asks the student to match each of a list of 'choices' with a corresponding 'answer'. Each possible pair can award a different number of marks.

\n

Match countries with their capital cities.

", "minMarks": 0, "maxMarks": 0, "minAnswers": 0, "maxAnswers": 0, "shuffleChoices": true, "shuffleAnswers": true, "displayType": "radiogroup", "warningType": "none", "showCellAnswerState": true, "choices": ["France", "Argentina", "China"], "matrix": [["1", 0, 0, 0, 0], [0, "1", 0, 0, 0], [0, 0, "1", 0, 0]], "layout": {"type": "all", "expression": ""}, "answers": ["Paris", "Buenos Aires", "Beijing", "Brussels", "Melbourne"]}, {"type": "yes-no", "useCustomName": true, "customName": "Custom part type - Yes/no", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

It's possible to create custom part types, or use one somebody else has published. A custom part type consists of settings for question authors, an input widget, and a marking algorithm. This part uses the \"Yes/No\" custom part type, which provides a simple means of asking if the student agrees with a statement.

\n

Was the abacus invented before the mobile phone?

", "settings": {"correct_answer_expr": "true"}}, {"type": "gapfill", "useCustomName": true, "customName": "Gap-fill", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The gap-fill part type allows you to include multiple input areas in one block of text. They're marked independently of each other, but submitted simultaneously, and all the feedback is shown together.

\n

My dog is 3 years older than my cat, who is half the dog's age. What are their ages?

\n

My dog's age: [[0]]

\n

My cat's age: [[1]]

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "Dog's age", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "6", "maxValue": "6", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "Cat's age", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "3", "maxValue": "3", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Numbas demo: multiple choice", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "parts": [{"extendBaseMarkingAlgorithm": true, "prompt": "

John, Paul, George and Ringo stand in alphabetical order. Who goes first?

", "adaptiveMarkingPenalty": 0, "maxMarks": 0, "showCellAnswerState": true, "showFeedbackIcon": true, "customName": "Choose one from a list", "unitTests": [], "customMarkingAlgorithm": "", "scripts": {}, "useCustomName": true, "choices": ["

John

", "

Paul

", "

George

", "

Ringo

"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "displayType": "radiogroup", "displayColumns": 0, "shuffleChoices": false, "distractors": ["J comes after G in the alphabet, so John comes after George", "P comes after J in the alphabet, so Paul comes after John", "", "R comes after P in the alphabet, so Ringo comes after Paul"], "variableReplacementStrategy": "originalfirst", "matrix": [0, 0, "1", 0], "type": "1_n_2", "minMarks": 0}, {"extendBaseMarkingAlgorithm": true, "prompt": "

Which of the following numbers are congruent to $1$ modulo $3$?

", "adaptiveMarkingPenalty": 0, "maxMarks": 0, "showCellAnswerState": true, "showFeedbackIcon": true, "customName": "Choose several from a list", "unitTests": [], "customMarkingAlgorithm": "", "scripts": {}, "minAnswers": "0", "useCustomName": true, "choices": ["

1

", "

2

", "

3

", "

4

", "

5

", "

6

", "

7

", "

8

", "

9

"], "showCorrectAnswer": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "marks": 0, "displayType": "checkbox", "displayColumns": "3", "shuffleChoices": false, "distractors": ["", "2 is not congruent to 1, mod 3", "3 is congruent to 0, mod 3", "", "5 is congruent to 2, mod 3", "6 is congruent to 0, mod 3", "", "8 is congruent to 2, mod 3", "9 is congruent to 0, mod 3"], "maxAnswers": "0", "matrix": ["1", "-1", "-1", "1", "-1", "-1", "1", "-1", "-1"], "type": "m_n_2", "warningType": "none", "minMarks": 0}, {"extendBaseMarkingAlgorithm": true, "adaptiveMarkingPenalty": 0, "maxMarks": 0, "showCellAnswerState": true, "showFeedbackIcon": true, "customName": "Match choices with answers", "unitTests": [], "customMarkingAlgorithm": "", "scripts": {}, "shuffleChoices": true, "useCustomName": true, "choices": ["Dodo", "Blue whale", "Human", "Pterodactyl"], "showCorrectAnswer": true, "variableReplacements": [], "shuffleAnswers": true, "variableReplacementStrategy": "originalfirst", "marks": 0, "layout": {"expression": "", "type": "all"}, "displayType": "checkbox", "minAnswers": 0, "maxAnswers": 0, "matrix": [["1", "-1", "1"], ["1", "-1", "-1"], ["1", "-1", "-1"], ["-1", "1", "1"]], "type": "m_n_x", "warningType": "none", "minMarks": 0, "answers": ["Warm-blooded", "Can fly", "Extinct"]}], "statement": "

Numbas has comprehensive support for multiple choice questions. The order of choices can be randomised, the marking matrix can be calculated from question variables, and you can write specific feedback for each choice.

\n

See this question in the public editor

", "rulesets": {}, "ungrouped_variables": [], "variables": {}, "metadata": {"description": "", "licence": "Creative Commons Attribution 4.0 International"}, "preamble": {"css": "", "js": ""}, "tags": [], "functions": {}, "advice": "", "variablesTest": {"condition": "", "maxRuns": 100}, "variable_groups": [], "type": "question"}, {"name": "Numbas demo: Motion under gravity", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "tags": ["2nd order differential equation", "acceleration", "applied mathematics", "Calculus", "calculus", "differential equations", "Differential equations", "graphs", "initial conditions", "integration", "interactive", "JSXgraph", "jsxgraph", "Jsxgraph", "modelling", "motion under gravity", "ode", "ODE", "plot solution", "second order differential equation", "velocity"], "metadata": {"description": "

Customised for the Numbas demo exam

\n

Motion under gravity. Object is projected vertically with initial velocity $V\\;m/s$. Find time to maximum height and the maximum height. Now includes an interactive plot.

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

A Numbas question can include interactive graphics, such as this plot of the trajectory given by the student's answer.

\n

See this question in the public editor

\n

A ball is thrown upwards, and moves according to the equation $\\displaystyle{\\frac{d^2z}{dt^2}=-g}$
(where $z(t)$ is distance in metres measured upwards from the ground and the constant acceleration of gravity, $g$ , is given as $9.81\\;m/s^2$).

\n

The ball is projected upwards with a speed $\\var{v}\\;m/s$.

", "advice": "

a)

\n

Integrating $\\displaystyle{\\frac{\\mathrm{d}^2z}{\\mathrm{d}t^2}=-g}$ once gives the velocity $\\displaystyle{\\frac{\\mathrm{d}z}{\\mathrm{d}t}=-gt+A}$.

\n

But $A=\\var{v}$ as the velocity is $\\var{V}\\;m/s$ at $t=0$.

\n

So the velocity is

\n

\\begin{align} \\frac{\\mathrm{d}z}{\\mathrm{d}t} &= \\var{v}-gt & (1) \\end{align}

\n

Integrating again gives

\n

\\[ z = \\var{v}t-\\frac{g}{2}t^2+B \\]

\n

and $B=0$ as $z=0$ at $t=0$.

\n

Hence the distance travelled upwards is given by

\n

\\begin{align} z &= \\var{v}t-\\frac{g}{2}t^2 & (2) \\end{align}

\n

{advicegraph()}

\n

b)

\n

The time $t_{\\text{max}}$ taken to reach maximum height is the time satisfying $\\displaystyle{\\frac{dz}{dt}=0}$

\n

$t_{\\text{max}}$ is given from equation $(1)$ by

\n

\\begin{align}
\\var{v} - gt_{\\text{max}} &= 0 \\\\
gt_{\\text{max}} &= \\var{v} \\\\
t_{\\text{max}} &= \\frac{\\var{v}}{g} \\\\[0.5em]
&= \\frac{\\var{v}}{9.81} \\\\[0.5em]
&= \\var{t1}
\\end{align}

\n

(to $2$ decimal places)

\n

This is at the point $A$ in the graph above.

\n

c)

\n

The maximum height $z_{\\text{max}}$ is given from equation $(2)$ by substituting in the value $t_{\\text{max}}= \\var{v}/g$, giving

\n

\\begin{align}
z_{\\text{max}} &= \\var{v} \\times \\frac{\\var{v}}{g} - \\frac{g}{2}\\left(\\frac{\\var{v}}{g}\\right)^2 \\\\
&= \\frac{\\var{v}^2}{g}-\\frac{g\\var{v}^2}{2g^2} \\\\
&= \\frac{\\var{v}^2}{2g} \\\\
&= \\var{mh}\\;m
\\end{align}

\n

(to $2$ decimal places)

\n

This is at the point $B$ in the graph above.

", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"mh": {"name": "mh", "group": "Ungrouped variables", "definition": "precround(V^2/(2*g),2)", "description": "", "templateType": "anything", "can_override": false}, "t1": {"name": "t1", "group": "Ungrouped variables", "definition": "precround(t,2)", "description": "", "templateType": "anything", "can_override": false}, "t": {"name": "t", "group": "Ungrouped variables", "definition": "V/g", "description": "", "templateType": "anything", "can_override": false}, "v": {"name": "v", "group": "Ungrouped variables", "definition": "random(50..100)", "description": "", "templateType": "anything", "can_override": false}, "g": {"name": "g", "group": "Ungrouped variables", "definition": "9.81", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["t", "v", "mh", "g", "t1"], "variable_groups": [], "functions": {"advicegraph": {"parameters": [], "type": "html", "language": "javascript", "definition": "var v = Numbas.jme.unwrapValue(scope.variables.v);\nvar mh = Numbas.jme.unwrapValue(scope.variables.mh);\nvar t = Numbas.jme.unwrapValue(scope.variables.t1);\nvar g = Numbas.jme.unwrapValue(scope.variables.g);\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',\n {boundingBox:[-3,mh+50,2*t+2,-50],\n axis:false,\n showNavigation:false,\n grid:false});\nvar brd = div.board; \n var xas = brd.create('line',[[0,0],[1,0]], { strokeColor: 'black',fixed:true});\n var xticks = brd.create('ticks',[xas,1],{\ndrawLabels: true,\nlabel: {offset: [-4, -10]},\nminorTicks: 0\n });\n var yas = brd.create('line',[[0,0],[0,1]], { strokeColor: 'black',fixed:true});\n var yticks = brd.create('ticks',[yas,50],{\ndrawLabels: true,\nlabel: {offset: [-20, 0]},\nminorTicks: 0\n }); \nfunction traj(x){return v*x-g*Math.pow(x,2)/2;}\nvar p=brd.create('point',[0,0],{fixed:true,name:'',size:1});\n//var q=brd.create('line',[[0,0],[1,v]],{fixed:true,name:'',dash:2});\nvar r=brd.create('point',[t,0],{fixed:true,name:'A',size:1});\nvar s=brd.create('point',[t,mh],{fixed:true,name:'B',size:1});\nvar maxh=brd.create(\"segment\",[[0,mh],[t,mh]],{dash:1,strokeColor:'green'});\nvar gr=brd.create(\"functiongraph\",[traj,0,2*t],{strokeColor:'blue',strokeWidth:2});\nvar halft=brd.create(\"segment\",[[t,0],[t,traj(t)]],{dash:1,strokeColor:'green'});\nreturn div;"}, "graphsolution": {"parameters": [], "type": "html", "language": "javascript", "definition": "var v = Numbas.jme.unwrapValue(scope.variables.v);\nvar mh = Numbas.jme.unwrapValue(scope.variables.mh);\nvar t = Numbas.jme.unwrapValue(scope.variables.t1);\nvar g = Numbas.jme.unwrapValue(scope.variables.g);\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',\n {boundingBox:[-3,mh+10,2*t+2,-50],\n axis:false,\n showNavigation:false,\n grid:false});\nvar brd = div.board; \nvar xas = brd.create('line',[[0,0],[1,0]], { strokeColor: 'black',fixed:true});\nvar xticks = brd.create('ticks',[xas,1],{\n drawLabels: true,\n label: {offset: [-4, -10]},\n minorTicks: 0\n});\nvar yas = brd.create('line',[[0,0],[0,1]], { strokeColor: 'black',fixed:true});\nvar yticks = brd.create('ticks',[yas,50],{\n drawLabels: true,\n label: {offset: [-20, 0]},\n minorTicks: 0\n}); \nvar p=brd.create('point',[0,0],{fixed:true,name:'',size:1});\nvar q=brd.create('line',[[0,0],[1,v]],{fixed:true,name:'',dash:2});\nvar tree;\n//x is the variable in the equation to be input\nvar nscope = new Numbas.jme.Scope([scope,{variables:{t:new Numbas.jme.types.TNum(0)}}]);\n//create a functiongraph from the student input\nfunction userf(t){\n if(tree) {\n try {\n nscope.variables.t.value = t;\n //the user input is evaluated at x=t\n var val = Numbas.jme.evaluate(tree,nscope).value;\n return val;\n }\n catch(e) {\n return 0;\n }\n }\n else\n return 0;\n}\nvar curve=brd.create('functiongraph',[userf,0,2*t],{strokeColor:'red',strokeWidth:2});\n\n//pick up the student answer and is parsed\nquestion.signals.on('HTMLAttached',function() {\n ko.computed(function(){\n var expr = question.parts[0].gaps[0].display.studentAnswer();\n try {\n tree = Numbas.jme.compile(expr,scope);\n tree = scope.expandJuxtapositions(tree,{singleLetterVariables:true});\n }\n catch(e) {\n tree = null;\n }\n curve.updateCurve();\n\n brd.update();\n });\n}); \n\nreturn div;"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "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": "

{graphsolution()}

\n

Input the vertical distance $z$ as a  function of $t$.

\n

Note that at $t=0$ we have $z=0$ and that $\\displaystyle \\frac{dz}{dt}=\\var{v}m/s$.

\n

Input gravitational acceleration as $g$.

\n

$z=$ [[0]]

\n

Your formula is plotted in the graph above. The vertical axis represents $z$ and the horizontal axis represents $t$.

\n

Note that the blue line indicates that:

\n
    \n
  1. Your solution should go through $(0,0)$;
  2. \n
  3. Your solution should have this line as the tangent to the curve at $(0,0)$, because $\\displaystyle \\frac{\\mathrm{d}z}{\\mathrm{d}t}=\\var{v}\\; m/s$.
  4. \n
", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{v}t-1/2g*t^2", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": true, "singleLetterVariables": true, "allowUnknownFunctions": false, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "g", "value": ""}, {"name": "t", "value": ""}]}], "sortAnswers": false}, {"type": "gapfill", "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": "

Time taken to reach maximum height = [[0]] $s$ (accurate to $2$ decimal places)

\n

Maximum height = [[1]] $m$ (accurate to $2$ decimal places)

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "t1", "maxValue": "t1", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "mh", "maxValue": "mh", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Numbas demo: video", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "variable_groups": [], "parts": [{"stepsPenalty": 1, "gaps": [{"vsetrange": [11, 12], "showpreview": true, "marks": 3, "notallowed": {"partialCredit": 0, "strings": ["."], "message": "

Input all numbers as fractions or integers and not decimals.

", "showStrings": false}, "answer": "({d-a*c}/{b-a})*ln(x+{a})+({d-b*c}/{a-b})*ln(x+{b})+C", "vsetrangepoints": 5, "variableReplacements": [], "showCorrectAnswer": true, "expectedvariablenames": [], "checkingaccuracy": 0.001, "type": "jme", "scripts": {}, "checkingtype": "absdiff", "checkvariablenames": false, "answersimplification": "std", "variableReplacementStrategy": "originalfirst"}], "type": "gapfill", "marks": 0, "scripts": {}, "steps": [{"type": "information", "marks": 0, "scripts": {}, "variableReplacements": [], "showCorrectAnswer": true, "prompt": "

First of all, factorise the denominator.

\n

You have to find $a$ and $b$ such that $\\simplify[std]{x^2+{a+b}*x+{a*b}=(x+a)*(x+b)}$

\n

Then use partial fractions to write:
\\[\\simplify[std]{({c}*x+{d})/((x +a)*(x+b)) = A/(x+a)+B/(x+b)}\\]

\n

for suitable integers or fractions $A$ and $B$.

\n

This video solves a similar, simpler example.

\n

", "variableReplacementStrategy": "originalfirst"}], "variableReplacements": [], "showCorrectAnswer": true, "prompt": "

$I=$ [[0]]

\n

Enter the constant of integration as $C$.

\n

Click on Show steps for help if you need it: you'll be given a hint, and see a video which solves a similar example.

", "variableReplacementStrategy": "originalfirst"}], "statement": "

It's easy to include videos in Numbas questions. In this question, if the student gets stuck they can click on \"Show steps\" to be given a hint, and shown a video of someone working through a similar problem.

\n

See this question in the public editor

\n

Find the following integral.

\n

\\[I = \\simplify[std]{Int(({c}*x+{d})/(x^2+{a+b}*x+{a*b}),x )}\\]

", "showQuestionGroupNames": false, "tags": ["2 distinct linear factors", "Calculus", "calculus", "completing the square", "constant of integration", "factorising a quadratic", "indefinite integration", "integrals", "integration", "logarithms", "partial fractions", "Steps", "steps", "two distinct linear factors", "video"], "ungrouped_variables": ["a", "c", "b", "d", "s3", "s2", "s1", "b1", "d1"], "functions": {}, "preamble": {"js": "", "css": ""}, "metadata": {"description": "

Customised for the Numbas demo exam

\n

Factorise $x^2+cx+d$ into 2 distinct linear factors and then find $\\displaystyle \\int \\frac{ax+b}{x^2+cx+d}\\;dx,\\;a \\neq 0$ using partial fractions or otherwise.

\n

Video in Show steps.

", "notes": "\n \t\t \t\t

5/08/2012:

\n \t\t \t\t

Added tags.

\n \t\t \t\t

Added description.

\n \t\t \t\t

Added decimal point as forbidden string.

\n \t\t \t\t

Note the checking range is chosen so that the arguments of the log terms are always positive - could have used abs - might be better?

\n \t\t \t\t

Improved display of Advice. 

\n \t\t \t\t

Added information about Show steps, also introduced penalty of 1 mark.

\n \t\t \t\t

Added !noLeadingMinus to ruleset std for display purposes.

\n \t\t \n \t\t", "licence": "Creative Commons Attribution 4.0 International"}, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "questions": [], "pickQuestions": 0}], "type": "question", "variablesTest": {"maxRuns": 100, "condition": ""}, "advice": "

First we factorise $\\simplify[std]{x^2+{a+b}*x+{a*b}=(x+{a})*(x+{b})}$. You can do this by spotting the factors or by completing the square.

\n

Next we use partial fractions to find $A$ and $B$ such that

\n

\\[ \\simplify[std]{({c}*x+{d})/((x +{a})*(x+{b})) = A/(x+{a})+B/(x+{b})} \\]

\n

Multiplying both sides of the equation by $\\displaystyle \\simplify[std]{1/((x +{a})*(x+{b}))}$, we obtain

\n

\\begin{align}
&& \\simplify[std]{A*(x+{b})+B*(x+{a})} &= \\simplify[std]{{c}*x+{d}}\\\\
\\Rightarrow && \\simplify[std]{(A+B)*x+{b}*A+{a}*B} &= \\simplify[std]{{c}*x+{d}}
\\end{align}

\n

Coefficients of similar powers of $x$ on each side of the equation must be equal, so we can write down two new equations identifying the coefficients on each side:

\n

Constant term: $\\simplify[std]{{b}*A+{a}*B = {d}}$

\n

Coefficent of $x$: $ \\simplify[std]{A+B={c}}$ which gives $A =\\var{c} -B$

\n

On solving these equations, we obtain $\\displaystyle \\simplify[std]{A = {d-a*c}/{b-a}}$ and $\\displaystyle \\simplify[std]{B={d-b*c}/{a-b}}$, which gives

\n

\\[ \\simplify[std]{({c}*x+{d})/((x +{a})*(x+{b})) = ({d-a*c}/{b-a})*(1/(x+{a}) )+({d-b*c}/{a-b})*(1/(x+{b}))} \\]

\n

So

\n

\\begin{align}
I &= \\simplify[std]{int(({c}*x+{d})/(x^2+{a+b}*x+{a*b}),x )} \\\\[0.5em]
&= \\simplify[std]{int(({c}*x+{d})/((x +{a})*(x+{b})),x )} \\\\[0.5em]
&= \\simplify[std]{({d-a*c}/{b-a})*(int(1/(x+{a}),x)) +({d-b*c}/{a-b})int(1/(x+{b}),x)} \\\\[0.5em]
&= \\simplify[std]{({d-a*c}/{b-a})*ln(x+{a})+({d-b*c}/{a-b})*ln(x+{b})+C}
\\end{align}

", "variables": {"c": {"name": "c", "description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..9)"}, "s2": {"name": "s2", "description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "random(1,-1)"}, "b1": {"name": "b1", "description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "s2*random(1..9)"}, "a": {"name": "a", "description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "s1*random(1..9)"}, "d": {"name": "d", "description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "if(d1=a*c,if(d1+1=b*c,d1+2,d1+1),if(d1=b*c,if(d1+1=a*c,d1+2,d1+1),d1))"}, "b": {"name": "b", "description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "if(b1=a,b1+s3,b1)"}, "s3": {"name": "s3", "description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "random(1,-1)"}, "d1": {"name": "d1", "description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "s3*random(1..9)"}, "s1": {"name": "s1", "description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "random(1,-1)"}}, "rulesets": {"std": ["all", "!collectNumbers", "fractionNumbers", "!noLeadingMinus"]}}], "pickQuestions": 0, "pickingStrategy": "all-ordered", "name": ""}], "shuffleQuestions": false, "duration": 0, "type": "exam", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "extensions": ["jsxgraph"], "custom_part_types": [{"source": {"pk": 1, "author": {"name": "Christian Lawson-Perfect", "pk": 7}, "edit_page": "/part_type/1/edit"}, "name": "Yes/no", "short_name": "yes-no", "description": "

The student is shown two radio choices: \"Yes\" and \"No\". One of them is correct.

", "help_url": "", "input_widget": "radios", "input_options": {"correctAnswer": "if(eval(settings[\"correct_answer_expr\"]), 0, 1)", "hint": {"static": true, "value": ""}, "choices": {"static": true, "value": ["Yes", "No"]}}, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\nif(studentanswer=correct_answer,\n correct(),\n incorrect()\n)\n\ninterpreted_answer:\nstudentAnswer=0\n\ncorrect_answer:\nif(eval(settings[\"correct_answer_expr\"]),0,1)", "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(studentanswer=correct_answer,\n correct(),\n incorrect()\n)"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "studentAnswer=0"}, {"name": "correct_answer", "description": "", "definition": "if(eval(settings[\"correct_answer_expr\"]),0,1)"}], "settings": [{"name": "correct_answer_expr", "label": "Is the answer \"Yes\"?", "help_url": "", "hint": "An expression which evaluates to true or false.", "input_type": "mathematical_expression", "default_value": "true", "subvars": false}], "public_availability": "always", "published": true, "extensions": []}], "resources": []}