// Numbas version: finer_feedback_settings {"name": "ISBN-10", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "ISBN-10", "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": "random(0..10)", "description": "", "templateType": "anything", "can_override": false}, "x2": {"name": "x2", "group": "Ungrouped variables", "definition": "random(0..10)", "description": "", "templateType": "anything", "can_override": false}, "x3": {"name": "x3", "group": "Ungrouped variables", "definition": "random(0..10)", "description": "", "templateType": "anything", "can_override": false}, "x4": {"name": "x4", "group": "Ungrouped variables", "definition": "random(0..10)", "description": "", "templateType": "anything", "can_override": false}, "x5": {"name": "x5", "group": "Ungrouped variables", "definition": "random(0..10)", "description": "", "templateType": "anything", "can_override": false}, "x6": {"name": "x6", "group": "Ungrouped variables", "definition": "random(0..10)", "description": "", "templateType": "anything", "can_override": false}, "x7": {"name": "x7", "group": "Ungrouped variables", "definition": "random(0..10)", "description": "", "templateType": "anything", "can_override": false}, "x8": {"name": "x8", "group": "Ungrouped variables", "definition": "random(0..10)", "description": "", "templateType": "anything", "can_override": false}, "x9": {"name": "x9", "group": "Ungrouped variables", "definition": "random(0..10)", "description": "", "templateType": "anything", "can_override": false}, "check_digit": {"name": "check_digit", "group": "Ungrouped variables", "definition": "mod(-check,11)", "description": "", "templateType": "anything", "can_override": false}, "parity": {"name": "parity", "group": "Ungrouped variables", "definition": "matrix([10,9,8,7,6,5,4,3,2])", "description": "", "templateType": "anything", "can_override": false}, "digits": {"name": "digits", "group": "Ungrouped variables", "definition": "transpose(matrix([x1,x2,x3,x4,x5,x6,x7,x8,x9]))", "description": "", "templateType": "anything", "can_override": false}, "check": {"name": "check", "group": "Ungrouped variables", "definition": "mod((parity*digits)[0][0],11)", "description": "", "templateType": "anything", "can_override": false}, "x1'": {"name": "x1'", "group": "Ungrouped variables", "definition": "if(x1=10,\"X\",string(x1))", "description": "", "templateType": "anything", "can_override": false}, "x2'": {"name": "x2'", "group": "Ungrouped variables", "definition": "if(x2=10,\"X\",string(x2))", "description": "", "templateType": "anything", "can_override": false}, "x3'": {"name": "x3'", "group": "Ungrouped variables", "definition": "if(x3=10,\"X\",string(x3))", "description": "", "templateType": "anything", "can_override": false}, "x4'": {"name": "x4'", "group": "Ungrouped variables", "definition": "if(x4=10,\"X\",string(x4))", "description": "", "templateType": "anything", "can_override": false}, "x5'": {"name": "x5'", "group": "Ungrouped variables", "definition": "if(x5=10,\"X\",string(x5))", "description": "", "templateType": "anything", "can_override": false}, "x6'": {"name": "x6'", "group": "Ungrouped variables", "definition": "if(x6=10,\"X\",string(x6))", "description": "", "templateType": "anything", "can_override": false}, "x7'": {"name": "x7'", "group": "Ungrouped variables", "definition": "if(x7=10,\"X\",string(x7))", "description": "", "templateType": "anything", "can_override": false}, "x8'": {"name": "x8'", "group": "Ungrouped variables", "definition": "if(x8=10,\"X\",string(x8))", "description": "", "templateType": "anything", "can_override": false}, "x9'": {"name": "x9'", "group": "Ungrouped variables", "definition": "if(x9=10,\"X\",string(x9))", "description": "", "templateType": "anything", "can_override": false}, "ISBN": {"name": "ISBN", "group": "Ungrouped variables", "definition": "x1' + x2' + x3' + x4' + x5' + x6' + x7' + x8' + x9' + \"?\"", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9", "check_digit", "parity", "digits", "check", "x1'", "x2'", "x3'", "x4'", "x5'", "x6'", "x7'", "x8'", "x9'", "ISBN"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "information", "useCustomName": true, "customName": "ISBN-10", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

ISBN-10 is an error-correcting code which, until 2007, was used to assign a unique identifier to every published book. It is now superseded by ISBN-13, but here we look at how it works.

\n

Each ISBN-10 code is a ten-digit number, using the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, X, where X stands for 10. All calculations are performed modulo 11. E..g, 147676669X.

\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 0131862391 we have $x_1 = 0$, $x_2 = 1$, $x_3 = 3$, etc. Then, for an ISBN $x_1x_2x_3x_4x_5x_6x_7x_8x_9x_{10}$, the following checksum must be satisfied:

\n

\\[ 10x_1 + 9x_2 + 8x_3 + 7x_4 + 6x_5 + 5x_6 + 4x_7 + 3x_8 + 2x_9 + 1x_{10} \\equiv 0 \\mod 11.\\]

\n

E.g., for 0131862391 we get

\n

\\[ (10 \\times 0) + (9 \\times 1) + (8 \\times 3) + (7 \\times 1) + (6 \\times 8) + (5 \\times 6) + (4 \\times 2) + (3 \\times 3) + (2 \\times 9) + (1 \\times 1) = 154 = 14 \\times 11 \\equiv 0 \\mod 11.\\]

"}, {"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-10 code $\\var{ISBN}$ and you are required to calculate the check digit, $x_{10}$. Use the information above to calculate this digit, entering 10 if the check digit is 10 (rather than X).

", "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/"}]}