Tutorial 10

Using the login object to control dialogue flow.

Instructions
Drag and arrange states onto the canvas so that you have the following setup:


Enter the following prompts into their respective states:

sign_in Please sign in.
welcome Welcome $user.
great Great $user, you used the login object to control branching.
redo Next time login as Sally.
goodbye Goodbye $user

The login object will present a list of names for the user to select from at run time. A variable called "user" is then set to the selected name. The knowledge of the user's identity can be useful in guiding dialogue flow, and personalizing prompts. In addition, this information is invaluable if the application is being used for education and assessment.

Select "Edit User List" from the "login" state's context menu to raise the login dialogue.

Type each of the following names into the text entry field, followed by a return. They will then be added to the list of names on the right:

Brian
Mary
Sally
Bill

Once you have entered the names, select "Ok" to exit the dialogue.


Next, you need to configure the conditional "sally" state. A boolean Tcl expression must be placed in each port. This is an expression which evaluates to either true or false (1 or 0). The ports are tested from the left to the right at run time, and the first true port is the one which will be used.


Double click on the left port of "sally", and enter the following expression:

$user == "Sally"

In the right port, simple enter the number "1". This is an expression that is always true. It is a good idea to always have a "1" port on conditional objects to ensure that the dialogue continues.