// Numbas version: exam_results_page_options {"name": "Scientific notation - both significand and exponent must be correct", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"ungrouped_variables": ["Planck", "powers_of_ten", "randomiser", "exponent", "significand"], "statement": "", "advice": "", "type": "question", "metadata": {"description": "

The student must enter a number in scientific notation, with separate boxes for significand and exponent. They only get the marks if both elements are correct.

", "licence": "Creative Commons Attribution 4.0 International"}, "variables": {"randomiser": {"definition": "10^((random(1..50000))/10000)", "group": "Ungrouped variables", "name": "randomiser", "templateType": "anything", "description": ""}, "significand": {"definition": "randomiser/(10^exponent)", "group": "Ungrouped variables", "name": "significand", "templateType": "anything", "description": ""}, "Planck": {"definition": "6.626*10^(-34)", "group": "Ungrouped variables", "name": "Planck", "templateType": "anything", "description": ""}, "exponent": {"definition": "floor(log(randomiser))", "group": "Ungrouped variables", "name": "exponent", "templateType": "anything", "description": ""}, "powers_of_ten": {"definition": "(10^-68)/(10^-66)", "group": "Ungrouped variables", "name": "powers_of_ten", "templateType": "anything", "description": ""}}, "tags": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "name": "Scientific notation - both significand and exponent must be correct", "rulesets": {}, "functions": {}, "preamble": {"css": "", "js": ""}, "variable_groups": [], "extensions": [], "parts": [{"customMarkingAlgorithm": "student_significand (The significand as the student entered it):\n parsenumber(studentanswer[0],\"en\")\n\nsignificand_size (If student's significand is written a*10^n, 1<=a<10, this is n):\n floor(log(abs(student_significand)))\n\nstudent_exponent (The exponent as the student wrote it):\n parsenumber(studentanswer[1],\"en\")\n\nnumbers_ok:\n assert(not isnan(student_significand),\n fail(\"Your significand is not a valid number.\")\n );\n assert(not isnan(student_exponent),\n fail(\"Your exponent is not a valid number.\")\n )\n\nadjusted_exponent (The exponent of the student's number, taking into account the size of their significand): \n student_exponent + significand_size\n\nadjusted_significand (The student's significand, scaled into the range 1..10):\n student_significand/(10^significand_size)\n\nsignificand_correct (Is the adjusted significand correct?):\n feedback(\"\");\n let(result,mark_part(gaps[0][\"path\"],string(adjusted_significand)),\n result[\"credit\"]=1\n )\n\nexponent_correct (Is the adjusted exponent correct?):\n feedback(\"Feedback:\");\n let(result,mark_part(gaps[1][\"path\"],string(adjusted_exponent)),\n result[\"credit\"]=1\n )\n\ncorrect:\n correctif(significand_correct and exponent_correct)\n\nmark:\n apply(significand_correct);\n apply(exponent_correct);\n apply(numbers_ok);\n apply(correct)\n\nsubmit_gaps:\n map(\n try(\n submit_part(gaps[gap_number][\"path\"],answer),\n err,\n fail(translate(\"part.gapfill.error marking gap\",[\"name\": gaps[gap_number][\"name\"], \"message\": err]))\n ),\n [gap_number,answer],\n zip(0..1,studentAnswer)\n )\n\ninterpreted_answer: [adjusted_significand, adjusted_exponent]", "showFeedbackIcon": true, "sortAnswers": false, "extendBaseMarkingAlgorithm": false, "scripts": {}, "marks": 0, "type": "gapfill", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "gaps": [{"maxValue": "{significand}+{significand}/50", "allowFractions": false, "showFeedbackIcon": false, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "scripts": {}, "mustBeReduced": false, "type": "numberentry", "minValue": "{significand}-{significand}/50", "showCorrectAnswer": true, "mustBeReducedPC": 0, "correctAnswerFraction": false, "marks": 1, "variableReplacements": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "notationStyles": ["plain", "en", "si-en"]}, {"maxValue": "{exponent}+{exponent}/50", "allowFractions": false, "showFeedbackIcon": false, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "scripts": {}, "mustBeReduced": false, "type": "numberentry", "minValue": "{exponent}-{exponent}/50", "showCorrectAnswer": true, "mustBeReducedPC": 0, "correctAnswerFraction": false, "marks": 1, "variableReplacements": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "notationStyles": ["plain", "en", "si-en"]}], "prompt": "

{significand}$\\times$10{exponent}

\n

\n

The answer is [[0]] $\\times$ 10[[1]]

", "variableReplacements": [], "unitTests": []}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Nick Walker", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2416/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Nick Walker", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2416/"}]}