// Numbas version: exam_results_page_options {"name": "Deirdre's copy of Ask for significand and exponent of a number in scientific notation separately", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"showfrontpage": false, "preventleave": false, "allowregen": true}, "question_groups": [{"questions": [{"type": "question", "advice": "", "tags": [], "name": "Deirdre's copy of Ask for significand and exponent of a number in scientific notation separately", "ungrouped_variables": ["significand", "exponent"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "metadata": {"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.

", "licence": "Creative Commons Attribution 4.0 International"}, "parts": [{"sortAnswers": false, "marks": 0, "scripts": {}, "type": "gapfill", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "prompt": "

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

\n

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

", "variableReplacements": [], "gaps": [{"notationStyles": ["plain", "en", "si-en"], "maxValue": "significand", "allowFractions": false, "scripts": {}, "marks": 1, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "variableReplacements": [], "correctAnswerFraction": false, "mustBeReduced": false, "mustBeReducedPC": 0, "correctAnswerStyle": "plain", "customMarkingAlgorithm": "", "unitTests": [], "minValue": "significand", "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true}, {"notationStyles": ["plain", "en", "si-en"], "maxValue": "exponent", "allowFractions": false, "scripts": {}, "marks": 1, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "variableReplacements": [], "correctAnswerFraction": false, "mustBeReduced": false, "mustBeReducedPC": 0, "correctAnswerStyle": "plain", "customMarkingAlgorithm": "", "unitTests": [], "minValue": "exponent", "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true}], "showCorrectAnswer": true, "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 \n\n\nmark:\n apply(significand_feedback);\n apply(exponent_feedback);\n apply(wrong_significand_size)\n\ninterpreted_answer: [adjusted_significand, adjusted_exponent]", "unitTests": [], "extendBaseMarkingAlgorithm": false}], "variablesTest": {"maxRuns": 100, "condition": ""}, "extensions": [], "contributors": [{"profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/", "name": "Christian Lawson-Perfect"}, {"profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/681/", "name": "Deirdre Casey"}], "rulesets": {}, "variables": {"significand": {"definition": "random(1..10#0.001 except 10)*random(-1,1)", "group": "Ungrouped variables", "name": "significand", "description": "", "templateType": "anything"}, "exponent": {"definition": "random(-100..100 except 0)", "group": "Ungrouped variables", "name": "exponent", "description": "", "templateType": "anything"}}, "statement": "

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

"}], "pickingStrategy": "all-ordered"}], "contributors": [{"profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/", "name": "Christian Lawson-Perfect"}, {"profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/681/", "name": "Deirdre Casey"}]}