User Tools

Site Tools


quick_and_dirty_if_then_else_intro

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

quick_and_dirty_if_then_else_intro [2013/10/11 13:52] (current)
Line 1: Line 1:
 +==== Multiple choice If Then Else - Quick and dirty ====
  
 +
 +Decision making is the hardest part im Wherigo programming. The good news is that once you have understood how it works, you are ready to build great cartridges.
 +
 +Here is a quick multiple choice solution to the decision making problem:
 +
 +=== Create a Variable (variable tab) to store the answers ===
 +
 +{{ :​create_your_first_cartridge:​qadif_expression.jpg |}}
 +
 +=== Create an Input (Input Tab) and ===
 +
 +      - reference it to your variable
 +      - select multiple choice as input type
 +      - add your answers in the multiple choice field
 +
 +{{ :​create_your_first_cartridge:​qadif_input.jpg |}}
 +
 +=== Compare user input ===
 + ​(stored in the variable answer) with the correct answer (Expression tab)
 +
 +{{ :​create_your_first_cartridge:​qadif_expression.jpg |}}
 +
 +=== Check the users answer ===
 +after each input (Input/​Events tab)
 +
 +{{ :​create_your_first_cartridge:​qadif_inputevent.jpg |}}
 +
 +
 +You should improve this basic concept by adding a Message that informs the user that his input was wrong and that he has to answer the question again. Also add a message that informs the user that he can see a new Zone after a correct input.
 +
 +Send me an email if you would like to have the above cartride segment to upload it to your account.
quick_and_dirty_if_then_else_intro.txt ยท Last modified: 2013/10/11 13:52 (external edit)