// Numbas version: exam_results_page_options {"name": "Set an HTML element's attributes based on a question variable", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"rulesets": {}, "ungrouped_variables": ["class", "color", "size"], "statement": "

This paragraph has class {class}.

\n

eval-class=\"{class}\"

\n

The text in this paragraph is {color} and {size} times bigger than normal.

\n

eval-style=\"color: {color}; font-size: {size}em\"

", "variablesTest": {"maxRuns": 100, "condition": ""}, "tags": [], "parts": [], "variable_groups": [], "variables": {"size": {"name": "size", "description": "", "group": "Ungrouped variables", "definition": "random(1..3#0.1)", "templateType": "anything"}, "class": {"name": "class", "description": "", "group": "Ungrouped variables", "definition": "random(\"blue-text\",\"yellow-background\")", "templateType": "anything"}, "color": {"name": "color", "description": "", "group": "Ungrouped variables", "definition": "random(\"red\",\"blue\")", "templateType": "anything"}}, "metadata": {"description": "

Use attributes of the form eval-<name> to dynamically set an attribute on an element based on question variables.

", "licence": "Creative Commons Attribution 4.0 International"}, "preamble": {"js": "", "css": ".blue-text {\n color: blue;\n}\n.yellow-background {\n background: yellow;\n}"}, "name": "Set an HTML element's attributes based on a question variable", "advice": "

a

", "type": "question", "extensions": [], "functions": {}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}