// Numbas version: exam_results_page_options {"name": "Ask for significand and exponent of a number in scientific notation separately", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variables": {"significand": {"name": "significand", "description": "", "definition": "random(1..10#0.001 except 10)*random(-1,1)", "templateType": "anything", "group": "Ungrouped variables"}, "exponent": {"name": "exponent", "description": "", "definition": "random(-100..100 except 0)", "templateType": "anything", "group": "Ungrouped variables"}}, "statement": "

This question shows how to ask for a number in scientific notation, by asking for the significand and exponent separately.

", "variable_groups": [], "name": "Ask for significand and exponent of a number in scientific notation separately", "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

This question shows how to ask for a number in scientific notation, by asking for the significand and exponent separately and using a custom marking algorithm in the gap-fill part to put the two pieces together.

\n

Answers not in standard form, i.e. with a significand not in $[1,10)$, are accepted but given partial marks.

"}, "variablesTest": {"maxRuns": 100, "condition": ""}, "parts": [{"sortAnswers": false, "extendBaseMarkingAlgorithm": false, "scripts": {}, "variableReplacementStrategy": "originalfirst", "marks": 0, "useCustomName": false, "type": "gapfill", "showCorrectAnswer": true, "prompt": "

Write $ \\var{significand} \\times 10^\\var{exponent}$.

\n

[[0]] $\\times 10$ [[1]]

", "variableReplacements": [], "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\nwrong_significand_size (Take away marks if significand is not in range 1..10):\n assert(significand_size=0,\n multiply_credit(0.5,\"Your significand is not at least 1 and less than 10.\")\n )\n\nstudent_exponent (The exponent as the student wrote it):\n parsenumber(studentanswer[1],\"en\")\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_feedback (Feedback on the adjusted significand: mark gap 0):\n feedback(\"Significand:\");\n let(result,apply_marking_script(\"numberentry\",string(adjusted_significand), gaps[0][\"settings\"],gaps[0][\"marks\"]),\n concat_feedback(result[\"mark\"][\"feedback\"],0.5)\n )\n\nexponent_feedback (Feedback on the adjusted exponent: mark gap 1):\n feedback(\"Exponent:\");\n let(result,apply_marking_script(\"numberentry\",string(adjusted_exponent), gaps[1][\"settings\"],gaps[1][\"marks\"]),\n concat_feedback(result[\"mark\"][\"feedback\"],0.5)\n )\n\nmark:\n apply(significand_feedback);\n apply(exponent_feedback);\n apply(wrong_significand_size)\n\ninterpreted_answer: [adjusted_significand, adjusted_exponent]", "unitTests": [], "customName": "", "gaps": [{"customName": "", "extendBaseMarkingAlgorithm": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "useCustomName": false, "minValue": "significand", "type": "numberentry", "mustBeReduced": false, "maxValue": "significand", "variableReplacements": [], "correctAnswerStyle": "plain", "customMarkingAlgorithm": "", "unitTests": [], "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "showFractionHint": true, "showFeedbackIcon": true, "correctAnswerFraction": false, "allowFractions": false, "marks": 1}, {"customName": "", "extendBaseMarkingAlgorithm": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "useCustomName": false, "minValue": "exponent", "type": "numberentry", "mustBeReduced": false, "maxValue": "exponent", "variableReplacements": [], "correctAnswerStyle": "plain", "customMarkingAlgorithm": "", "unitTests": [], "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "showFractionHint": true, "showFeedbackIcon": true, "correctAnswerFraction": false, "allowFractions": false, "marks": 1}], "showFeedbackIcon": true}], "functions": {}, "tags": [], "extensions": [], "preamble": {"css": "", "js": ""}, "rulesets": {}, "ungrouped_variables": ["significand", "exponent"], "advice": "", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}]}