// Numbas version: exam_results_page_options {"name": "Johan's copy of Quantities", "extensions": ["quantities"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"statement": "

An object has mass {mass} and volume {volume}.

\n

Its density is {density}.

", "variable_groups": [], "extensions": ["quantities"], "tags": [], "preamble": {"js": "", "css": ""}, "rulesets": {}, "advice": "", "variables": {"volume": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "name": "volume", "definition": "random(300..500#100)*quantity(\"m^3\")"}, "mass": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "name": "mass", "definition": "as(\"kg\",density*volume)"}, "density": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "name": "density", "definition": "random(1..10)*quantity(\"g/m^3\")"}}, "functions": {}, "parts": [{"displayAnswer": "{string(tobase(density))}", "marks": 1, "matchMode": "exact", "showCorrectAnswer": true, "prompt": "

What is the object's density, in SI units?

", "scripts": {}, "customMarkingAlgorithm": "student_quantity:\n quantity(studentanswer)\n\ncorrect_quantity:\n tobase(density)\n\ncompatible:\n assert(compatible(student_quantity,correct_quantity),\n incorrect(\"Your answer does not have the correct dimensions.\");\n end();\n false\n )\n\nstudent_base:\n tobase(student_quantity)\n\nsame_units:\n assert(units(student_quantity)=units(correct_quantity),\n feedback(\"Your answer is not in the expected units.\");\n false\n )\n\nis_base_units:\n assert(isbase(student_quantity),\n feedback(\"Your answer is not in SI units.\");\n false\n )\n\nmark:\n apply(compatible);\n apply(same_units);\n apply(is_base_units);\n correctif(student_quantity=correct_quantity)\n\ninterpreted_answer:\n student_quantity", "unitTests": [], "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": false, "variableReplacements": [], "type": "patternmatch", "variableReplacementStrategy": "originalfirst", "answer": "{string(density)}"}], "metadata": {"description": "

Fiddling about with a new extension providing a \"quantity\" data type: an amount with units.

", "licence": "Creative Commons Attribution 4.0 International"}, "name": "Johan's copy of Quantities", "variablesTest": {"maxRuns": 100, "condition": ""}, "ungrouped_variables": ["density", "volume", "mass"], "type": "question", "contributors": [{"name": "Johan Maertens", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1301/"}]}]}], "contributors": [{"name": "Johan Maertens", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1301/"}]}