// Numbas version: finer_feedback_settings {"name": "Emma's copy of Show a block of HTML based on a random value", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"tags": ["demo"], "type": "question", "rulesets": {}, "variables": {"a": {"group": "Ungrouped variables", "definition": "random(1,2,3)", "name": "a", "description": "", "templateType": "anything"}}, "statement": "
Click Try another question like this one to re-randomise the question and see a different block of text.
", "ungrouped_variables": ["a"], "functions": {"showdiv": {"type": "html", "definition": "//hide all the divs\n$('.choosediv').hide();\n\n//show the one corresponding to the parameter n.\n$('#statement-'+n).show();\n return $('');", "language": "javascript", "parameters": [["n", "number"]]}}, "preamble": {"js": "", "css": ""}, "variablesTest": {"condition": "", "maxRuns": 100}, "variable_groups": [], "advice": "", "metadata": {"licence": "Creative Commons Attribution 4.0 International", "notes": "In this question, each possible bit of content is given a unique ID and set to be hidden by default. A custom javascript function shows the relevant content based on the random variable.
\nTurn off the rich text editor on the statement to see what's going on.
", "description": "Update: you can now use the conditional visibility button to do this more easily - see the documentation.
\nIf the statement or advice for your question differs greatly depending on a random variable (for instance, if you're picking from a selection of scenarios), you only want to show content for the relevant scenario.
\nThis question shows one way of doing that.
"}, "parts": [], "showQuestionGroupNames": false, "name": "Emma's copy of Show a block of HTML based on a random value", "question_groups": [{"pickQuestions": 0, "name": "", "pickingStrategy": "all-ordered", "questions": []}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Emma Cliffe", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1343/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Emma Cliffe", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1343/"}]}