Larson Technical Services: Voice Technology Consulting

Exercise 10.1

Write two versions of a VoiceXML form that solicits first name and age from a job applicant:

Test exercise 10.1

The VoiceXML form should be application driven.


<?xml version="1.0"?>
<!DOCTYPE vxml PUBLIC "-//BeVocal Inc//VoiceXML 2.0//EN" 
 "http://cafe.bevocal.com/libraries/dtd/vxml2-0-bevocal.dtd">
 <vxml version="2.0" xmlns = "http://www.w3.org/2001/vxml">
<!-- Exercise 10.1.A  System directed dialog  -->  
<form id = "job_application_form">  

<block>
     <prompt>
          Welcome to the job application form
     </prompt>
</block>

<field name = "name">
     <prompt>
          What is your name?
     </prompt>
     <grammar type = "application/grammar+xml" 
          root = "applicant_name">
               <rule id = "applicant_name">
                    <one-of>
                         <item> sam </item>
                         <item> fred </item>
               </one-of>
          </rule>
     </grammar>
</field>

<field name = "age">
     <prompt>
          How old are you?
     </prompt>
     <grammar type = "application/grammar+xml" 
          root = "applicant_age">
               <rule id = "applicant_age">
                    <one-of>
                         <item> twenty </item>
                         <item> thirty </item>
                    </one-of>
               </rule>
     </grammar>
</field>

<filled>  
     <prompt>
          Your name is <value expr = "name"/>
          Your age is <value expr = "age"/>
          Good Bye
     </prompt>   
</filled>
</form>
</vxml>

B. The VoiceXML form should be mixed initiative.


<?xml version="1.0"?> 

<!DOCTYPE vxml PUBLIC "-//BeVocal Inc//VoiceXML 2.0//EN" 
 "http://cafe.bevocal.com/libraries/dtd/vxml2-0-bevocal.dtd">
 <vxml version="2.0" xmlns = "http://www.w3.org/2001/vxml">

<!-- exercise 10.1.B.  Mixed-initiative dialog -->

<form id = "job_application_form">  
<grammar type = "application/grammar+xml" 
     src="job_form.grxml"/>

<initial name = "start">
     <prompt>
          What are you name and age?
     </prompt>
</initial>

<field name = "name">
     <prompt>
          What is your Name?
     </prompt>
     <grammar type = "application/grammar+xml" 
          src = "job_form.grxml#applicant_name"/>
</field>

<field name = "age">
     <prompt>
          What is your age?
     </prompt>
     <grammar type = "application/grammar+xml" 
          src = "job_form.grxml#applicant_age"/>
</field>

<filled>  
     <prompt>
          Your name is <value expr = "name"/>
          Your age is <value expr = "age"/>
          Good Bye
     </prompt>   
</filled>
</form>
</vxml>

The following grammar is stored as job_form.grxml


<grammar type = "application/grammar+xml" root="job_form"
     xml:lang = "en">
          <rule id = "job_form" scope = "public">
               <item repeat = "1-">
                    <one-of> 
                         <item>
                              <ruleref uri= "#applicant_name" /> 
                         </item>
                         <item>
                              <ruleref uri= "#applicant_age" /> 
                         </item>
                    </one-of>
               </item>
          </rule>
          <rule id = "applicant_name" scope = "public">
               <one-of>
                    <item> sam <tag>name="sam"</tag> </item>
                    <item> fred <tag>name="fred"</tag> </item>
               </one-of>
          </rule>
          <rule id = "applicant_age" scope = "public">
               <one-of>
                    <item> twenty<tag>age="twenty"</tag>  </item>
                    <item> thirty <tag>age="thrity"</tag> </item>
               </one-of>
          </rule>
</grammar>

C. Perform a comparison test of (a) and (b) with novice callers. Which version do you recommend for novice callers?

Most novice users prefer (a) because it leads them to do the right thing. They don’t have to guess what the right words are.

D. Perform a comparison test of (a) and (b) with experienced callers. Which version do you recommend for experienced callers?

Several experienced users (who understand mixed initiative dialogs) find (b) faster. However, they can always drop back into the application-directed mode when they need to.

Return to the Instructor’s Page

Comments are off for this post