// Numbas version: exam_results_page_options {"name": "Displaying a randomised LaTeX command", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Displaying a randomised LaTeX command", "tags": [], "metadata": {"description": "

Demonstrates how to create variables containing LaTeX commands, and how to use them in the question text.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

If you don't wrap the string in the latex function, it's displayed as plain text:

\n

$\\var{expression}$

\n

$\\var{expression}$

\n

The correct way to do it is as follows:

\n

$\\var{latex(expression)}$

\n

$\\var{latex(expression)}$

", "advice": "", "rulesets": {}, "extensions": [], "variables": {"expressions": {"name": "expressions", "group": "Ungrouped variables", "definition": "[\n safe(\"\\\\frac{1}{2}\"),\n safe(\"\\\\sin(x)\"),\n safe(\"2 + \\\\hat{x}\")\n]", "description": "", "templateType": "anything"}, "expression": {"name": "expression", "group": "Ungrouped variables", "definition": "random(expressions)", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["expressions", "expression"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "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/"}]}