// Numbas version: finer_feedback_settings {"name": "ISBN-13", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "ISBN-13", "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "", "advice": "", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"x1": {"name": "x1", "group": "Ungrouped variables", "definition": "9", "description": "", "templateType": "anything", "can_override": false}, "x2": {"name": "x2", "group": "Ungrouped variables", "definition": "7", "description": "", "templateType": "anything", "can_override": false}, "x3": {"name": "x3", "group": "Ungrouped variables", "definition": "8", "description": "", "templateType": "anything", "can_override": false}, "x4": {"name": "x4", "group": "Ungrouped variables", "definition": "random(0..9)", "description": "", "templateType": "anything", "can_override": false}, "x5": {"name": "x5", "group": "Ungrouped variables", "definition": "random(0..9)", "description": "", "templateType": "anything", "can_override": false}, "x6": {"name": "x6", "group": "Ungrouped variables", "definition": "random(0..9)", "description": "", "templateType": "anything", "can_override": false}, "x7": {"name": "x7", "group": "Ungrouped variables", "definition": "random(0..9)", "description": "", "templateType": "anything", "can_override": false}, "x8": {"name": "x8", "group": "Ungrouped variables", "definition": "random(0..9)", "description": "", "templateType": "anything", "can_override": false}, "x9": {"name": "x9", "group": "Ungrouped variables", "definition": "random(0..9)", "description": "", "templateType": "anything", "can_override": false}, "check_digit": {"name": "check_digit", "group": "Ungrouped variables", "definition": "mod(-check,10)", "description": "", "templateType": "anything", "can_override": false}, "parity": {"name": "parity", "group": "Ungrouped variables", "definition": "matrix([1,3,1,3,1,3,1,3,1,3,1,3])", "description": "", "templateType": "anything", "can_override": false}, "digits": {"name": "digits", "group": "Ungrouped variables", "definition": "transpose(matrix([x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12]))", "description": "", "templateType": "anything", "can_override": false}, "check": {"name": "check", "group": "Ungrouped variables", "definition": "mod((parity*digits)[0][0],10)", "description": "", "templateType": "anything", "can_override": false}, "ISBN": {"name": "ISBN", "group": "Ungrouped variables", "definition": "string(x1) + string(x2) + string(x3) + string(x4) + string(x5) + string(x6) + string(x7) + string(x8) + string(x9) + string(x10) + string(x11) + string(x12) + \"?\"", "description": "", "templateType": "anything", "can_override": false}, "x10": {"name": "x10", "group": "Ungrouped variables", "definition": "random(0..9)", "description": "", "templateType": "anything", "can_override": false}, "x11": {"name": "x11", "group": "Ungrouped variables", "definition": "random(0..9)", "description": "", "templateType": "anything", "can_override": false}, "x12": {"name": "x12", "group": "Ungrouped variables", "definition": "random(0..9)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9", "x10", "x11", "x12", "check_digit", "parity", "digits", "check", "ISBN"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "information", "useCustomName": true, "customName": "ISBN-13", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

ISBN-13 is an error-correcting code which superceded ISBN-10 to assign a unique identifier to every published book. Its checksum calculation also matches that of barcodes.

\n

Each ISBN-13 code is a thirteen-digit number, using the digits 0 to 9. All calculations are performed modulo 10. E..g, 9781476766690.

\n

The last digit is a check digit, which is calculated based on the previous nine digits. Let $x_i$ represent the digit in position $i$ of the ISBN, e.g., in 9780131862395 we have $x_1 = 9$, $x_2 = 7$, $x_3 = 8$, $\\ldots$, $x_{13} = 5$ etc. Then, for an ISBN $x_1x_2x_3x_4x_5x_6x_7x_8x_9x_{10}x_{11}x_{12}x_{13}$, the following checksum must be satisfied:

\n

\\[ x_1 + 3x_2 + x_3 + 3x_4 + x_5 + 3x_6 + x_7 + 3x_8 + x_9 + 3x_{10} + x_{11} + 3x_{12} + x_{13} \\equiv 0 \\mod 10.\\]

\n

E.g., for 9780131862395 we get

\n

\\[ 9 + (3 \\times 7) + 8 + (3 \\times 0) + 1 + (3 \\times 3) + 1 + (3 \\times 8) + 6 + (3 \\times 2) + 3 + (3 \\times 9) + 5 = 120 = 12 \\times 10 \\equiv 0 \\mod 10.\\]

"}, {"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, "prompt": "

You are given the incomplete ISBN-13 code $\\var{ISBN}$ and you are required to calculate the check digit, $x_{13}$.

", "minValue": "{check_digit}", "maxValue": "{check_digit}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Alexander Corner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/5328/"}], "resources": []}]}], "contributors": [{"name": "Alexander Corner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/5328/"}]}