But sometimes we'll want to use those built-in grammars
<grammar src="builtin:grammar/boolean"/>
Translating this to VXML
Each field has a variable assigned to it (its name)
Recall..
Do you like cheeseburgers?
What would that look like in VXML?
<fieid name="likecheeseburgers">
<prompt>Do you like cheeseburgers?</prompt>
<grammar src="builtin:grammar/boolean"/>
</field>
Another example
<fieid name="school">
<prompt>Where do you go to school?</prompt>
<grammar type="application/x-nuance-gsl">
<![CDATA[
Schools [mit harvard tufts]
]]>
<grammar>
</field>
Using user input
To access what the user just said to us, we're going to have to learn some new tags
<filled>
<value>
<filled>
When a user says something - we'll call an 'utterance' - the field is considered filled
<filled> is a child of field
<fieid name="school">
<prompt>Where do you go to school?</prompt>
<grammar type="application/x-nuance-gsl">
<![CDATA[
Schools [mit harvard tufts]
]]>
<grammar>
<filled>
...
</filled>
</field>
<value>
Used to play back a variable
Recall, every field has an associated variable with it, its name
In many cases, we'll want to use this variable
We can make decisions based on it or simply play it back
<value> is used to play it back
<value expr="school"/>
How we'd use value
<value> is a child of <prompt>, which is a valid child of <filled>
Once a user says something, we may want to repeat it back to them
<fieid name="school">
<prompt>Where do you go to school?</prompt>
<grammar type="application/x-nuance-gsl">
<![CDATA[
Schools [mit harvard tufts]
]]>
<grammar>
<filled>
<prompt>You said you go to <value expr="school"/></prompt>
</filled>
</field>
A primer on flow
Multiple field can exist in a form
You can access their variables in side of any other field
Once one field is done executing (it is filled), we automatically move to the next field
Debugging in the Cafe
Log Browser
Vocal Scripter
In-class exercise 1
Create a VXML file that contains 1 grammar
You can ask any question that has a set number of responses (that isn't yes/no)
You must write your own grammar, don't use a built-in grammar
Have the system repeat back the answer
In-class exercise 2
Create a VXML application that gathers which class the caller is in (freshmen, senior, etc), which dorm they live in (or 'off campus'), and if they're enrolled in ESD.951
You'll need to use 3 fields
Don't worry about the completeness of the dorm grammar
Use 1 built-in grammar
Use 1 block at the end instead of a field to repeat back all of the answers in a sentence
Homework
Create a VXML application that has at least 5 fields
Use at least 1 built-in grammar
Repeat back everything the user said at some point, doesn't have to be all in one state