// Numbas version: exam_results_page_options {"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}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Numbas demo: part types", "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": {}, "extensions": [], "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", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}