// Numbas version: finer_feedback_settings {"name": "Calculate molar mass", "extensions": ["experimental-error"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "feedback": {"showactualmarkwhen": "always", "showtotalmarkwhen": "always", "showanswerstatewhen": "always", "showpartfeedbackmessageswhen": "always", "allowrevealanswer": true, "showexpectedanswerswhen": "inreview", "showadvicewhen": "inreview"}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Calculate molar mass", "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "
Determine the molar mass of {compound_string}.
\nUsing:
\n{table}
", "advice": "Since the minimum number of decimal places given for the relative atomic mass of the elements is {min_dp}.
\nAdd up all the relative atomic masses then round to {min_dp}.
\n{calculation}
\n", "rulesets": {}, "extensions": ["experimental-error"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"molar_masses": {"name": "molar_masses", "group": "Ungrouped variables", "definition": "['H':1.00794,\n'C':12.011,\n'O':15.9994,\n'N':14.0067,\n'Cl':35.45]", "description": "", "templateType": "anything", "can_override": false}, "tails": {"name": "tails", "group": "Ungrouped variables", "definition": "random([['H':1,'O':1],['Cl':1],['N':1,'H':2]])", "description": "", "templateType": "anything", "can_override": false}, "base": {"name": "base", "group": "Ungrouped variables", "definition": "random([['C':1,'H':3],['C':2,'H':5],['C':3,'H':7],['C':4,'H':9],['C':5,'H':11]])", "description": "", "templateType": "anything", "can_override": false}, "compound": {"name": "compound", "group": "Ungrouped variables", "definition": "add_dict(base,tails)", "description": "", "templateType": "anything", "can_override": false}, "answer": {"name": "answer", "group": "Ungrouped variables", "definition": "dec(add(map(string(molar_masses[k]* compound[k]), k, keys(compound))))", "description": "", "templateType": "anything", "can_override": false}, "compound_string": {"name": "compound_string", "group": "Ungrouped variables", "definition": "join(\n map(k+if(compound[k]=1,\"\",\"$_{\"+ string(compound[k])+\"}$\"),\n k, \n keys(compound)),\n '')", "description": "", "templateType": "anything", "can_override": false}, "table": {"name": "table", "group": "Ungrouped variables", "definition": "dict_table(molar_masses)", "description": "", "templateType": "anything", "can_override": false}, "min_dp": {"name": "min_dp", "group": "Ungrouped variables", "definition": "min(map(dp_of(string(molar_masses[k])), k, keys(compound)))", "description": "", "templateType": "anything", "can_override": false}, "calculation": {"name": "calculation", "group": "Ungrouped variables", "definition": "\"$\"+join(map(string(molar_masses[k])+\"\\\\times\"+string(compound[k]), k, keys(compound)),'+')+\"$\"", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["molar_masses", "tails", "base", "compound", "answer", "compound_string", "table", "min_dp", "calculation"], "variable_groups": [], "functions": {"add_dict": {"parameters": [["d1", "dict"], ["d2", "dict"]], "type": "dict", "language": "jme", "definition": "dict(map([k, try(d1[k],err,0) + try(d2[k],err,0)], k, set(keys(d1)+keys(d2))))"}, "dict_table": {"parameters": [["d", "dict"]], "type": "html", "language": "jme", "definition": "table(map([k, d[k]], k, sort(keys(d))), [\"Element\", \"Mass\"])"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "minValue": "answer", "maxValue": "answer", "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", "showAllParts": false, "contributors": [{"name": "Ed Southwood", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2415/"}], "resources": []}]}], "contributors": [{"name": "Ed Southwood", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2415/"}]}