// Numbas version: exam_results_page_options {"name": "Adrian's copy of Conditional visibility", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [{"variables": ["scenario"], "name": "Scenario"}, {"variables": ["a", "b", "c"], "name": "Quadratic equation"}], "advice": "", "functions": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "metadata": {"description": "

Show one of several blocks of text depending on the value of a question variable.

\n

As well as a simple check for the value of a variable, the condition to display a block of text can be a complex expression in any of the question variables - in this example, depending on the discriminant of the generated quadratic.

", "notes": "", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "preamble": {"css": "", "js": ""}, "tags": ["conditional visibility", "demo"], "showQuestionGroupNames": false, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "parts": [], "ungrouped_variables": [], "variables": {"b": {"definition": "random(-6..6 except 0)", "group": "Quadratic equation", "templateType": "anything", "description": "", "name": "b"}, "c": {"definition": "random(-4..4 except 0)", "group": "Quadratic equation", "templateType": "anything", "description": "", "name": "c"}, "a": {"definition": "random(1..3)", "group": "Quadratic equation", "templateType": "anything", "description": "", "name": "a"}, "scenario": {"definition": "random(1,2,3)", "group": "Scenario", "templateType": "anything", "description": "

Choose between three scenarios.

", "name": "scenario"}}, "name": "Adrian's copy of Conditional visibility", "rulesets": {}, "statement": "

First, this question picks between three scenarios.

\n
\n

This is Scenario 1.

\n
\n
\n

This is Scenario 2.

\n
\n
\n

This is Scenario 3.

\n
\n

Now, consider the quadratic equation

\n

\\[ \\simplify{{a}x^2+{b}x+{c} = 0} \\]

\n

The discriminant of this equation is $\\simplify[!basic]{{b}^2-4*{a}*{c}} = \\var{b^2-4*a*c}$. This is greater than zero, so the equation has two real roots. As this is zero, the equation has one repeated root. This is less than zero, so the equation has no real roots.

", "contributors": [{"name": "Adrian Jannetta", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/164/"}]}]}], "contributors": [{"name": "Adrian Jannetta", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/164/"}]}