// Numbas version: exam_results_page_options {"name": "Two numbers meeting a specific condition", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Two numbers meeting a specific condition", "tags": [], "metadata": {"description": "

Marks two gaps correrct, if the numbers meet a specific condition (here: product is a given number).

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "", "advice": "", "rulesets": {}, "extensions": [], "variables": {"n": {"name": "n", "group": "Ungrouped variables", "definition": "12", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["n"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {"mark": {"script": "// Get the student's answer to the first gap.\n// This is a JME token. Since the first gap is a number entry, it's a TNum object.\nvar studentM = part.question.getPart('p0g0').studentAnswerAsJME();\nvar studentN = part.question.getPart('p0g1').studentAnswerAsJME();\nvar variables = this.question.scope.variables;\nvar unwrap = Numbas.jme.unwrapValue;\n\n// get the roots of the equation\nvar product = unwrap(variables.n);\n\n// Unwrap the JME token to get a JavaScript number.\nstudentM = Numbas.jme.unwrapValue(studentM);\nstudentN = Numbas.jme.unwrapValue(studentN);\n\n// Now we can do something with the number.\n// For this example, I'll just add a marking comment saying what the number was.\n// this.markingComment(\"you wrote \"+studentN+\".\"+studentM);\nif (studentM*studentN==product) {\n this.setCredit(1,\"Correct.\");\n }\nif (studentM*studentN!=product) {\n this.setCredit(0,\"Incorrect: \"+studentM+\"*\"+studentN+\"=\"+(studentN*studentM));\n }", "order": "after"}}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Write two natural numbers $a,b$ of which the product is 12! $a=$ [[0]], $b=$ [[1]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "n", "maxValue": "n", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [{"variable": "n", "part": "p0g0", "must_go_first": true}], "variableReplacementStrategy": "alwaysreplace", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "2n", "maxValue": "2n", "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/"}, {"name": "Andreas Vohns", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3622/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Andreas Vohns", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3622/"}]}