- Specify a `name` for each question. A default name like `question1` will be provided automatically in the SurveyJS builder. It's better to use a descriptive name to make the generated `content.json` file more readable.
The survey included with the HAX Playbook has a cascading-question effect, causing new questions to appear when the user selects an answer.
Cascading questions are implemented by configuring the visibility rules for questions in the survey.
The visibility rules can be configured in the SurveyJS builder or in the JSON file.
To configure visibility in the SurveyJS builder, select the question to modify, then select the `Visible if` rule in the `Logic` section of the `Properties` toolbar.
A cascading-question effect is implemented by using the rule `{previous_question_name} is not empty`.
Effectively, this rule says, "if an answer has been selected for the previous question, then show this question."
by providing an introduction, instructions for each survey question, contextual help for each choice, and tasks for each choice. HTML is supported inside each component.
- visibleIf: A logic expression that controls whether or not this example is visible. This can be used to provide contextual examples based on the user's choices in the survey. [Syntax documentation](#syntax-for-visibleif-logic)
- visibleIf: A logic expression that controls whether or not this task is visible. This can be used to provide contextual tasks based on the user's choices in the survey. [Syntax documentation](#syntax-for-visibleif-logic)
### Syntax for visibleIf logic
SurveyJS includes a robust domain-specific language for controlling the flow of the survey. See https://surveyjs.io/Documentation/Library#conditions for the official documentation and examples. Configuring logic in the [survey creator](https://surveyjs.io/create-survey) is a good option if you don't want to handwrite code.
Here are some basic examples to get you started.
- Check if the user selected a certain choice: `"visibleIf": "{questionName} = 'choice'"`
- Check if the user **did not** select a choice: `"visibleIf": "{questionName} <> 'choice'"`
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.