Conditional statements are central to creating interactive elearning. They make it possible to express statements like:
The simplest conditional statement is an if block, as shown:
When run, this will check to see if the value of the variable score is greater than or equal to 90. If it is, Text 1 will display "Wow, you really know your stuff!". Otherwise, nothing happens.
It is also possible to specify that something should happen if the condition is not true, as shown in this example:
As with the previous block, this will check to see if the value of the variable score is greater than or equal to 90. If it is, Text 1 will display "Wow, you really know your stuff!". Otherwise, Text 1 will display "Wow, you really know your stuff!"
It is also possible to test multiple conditions with a single if block by adding else if clauses: