Branching scenarios are a good method of testing students ability to work through a problem or situation they may experience and apply the knowledge they have gained.
Linear scenarios are relatively simple to write however branching scenarios can get quite complex due to the different pathways a student may encounter as they work through it.
The below 3 part guide will give you a good understanding of how to write branching scenarios.
How to Get Started Writing a Branching Scenario for Learning
What to Write First in Branching Scenarios
The tool recommended in this guidance is called Twine which can be downloaded here.