Presentation is loading. Please wait.

Presentation is loading. Please wait.

Student Pages

Similar presentations


Presentation on theme: "Student Pages"— Presentation transcript:

1 Student Pages http://www.clsp.jhu.edu/~anni/roster.html

2 Last Time: HTML Forms and Javascript If you haven’t finished the survey assignment, email us or come to office hours

3 2/14: Programming Phones

4 This script says “hello world” Hello World!

5 This script says “hello world” Hello World! Call 877-500-VXML and use my developer ID (540460366) and pin (0123) to preview it When you’re done, put this text into your Scratchpad and call VXML again and use your developer ID and pin to preview your own code

6 Prerequisite: XML

7 XML Disclaimer: This is an introduction to how an XML format works in general, this is not the particular syntax of a VoiceXML program or any other specific XML format

8 XML Opening and closing tags

9 XML Nested hierarchy of tags Hello World Hi, What’s up? …

10 XML Nested hierarchy of tags Hello World Hi, What’s up? … Level 1 (Document Root)

11 XML Nested hierarchy of tags Hello World Hi, What’s up? … Level 1 (Document Root) Level 1 (Document Root) Level 2

12 XML Nested hierarchy of tags Hello World Hi, What’s up? … Level 1 (Document Root) Level 2 Level 3

13 XML Tag Attributes Hello World Hi, What’s up? … Attribute Value

14 XML Comments Hello World Hi, What’s up? …

15 VoiceXML (Programming Phones)

16 This script says “hello world” Hello World!

17 VoiceXML (Programming Phones)

18 VoiceXML (Programming Phones)

19 VoiceXML (Programming Phones)

20 VoiceXML (Programming Phones)

21 VoiceXML: Form Blocks Hello World! Audio (“Text to Speech”) Exit the application

22 VoiceXML: Form Blocks Hello World! Note beginning and end tags

23 VoiceXML: Form Blocks Hello World! This should be what’s in your Scratchpad now

24 Back to Javascript Just like you can embed Javascript into HTML, you can embed Javascript into VoiceXML https://studio.tellme.com/vxml2/ovw/javascript.html

25 Back to Javascript Just like you can embed Javascript into HTML, you can embed Javascript into VoiceXML https://studio.tellme.com/vxml2/ovw/javascript.html But we won’t do that in this class…

26 VoiceXML: tag Hello World!

27 VoiceXML: tag Hello World! Tag

28 VoiceXML: tag Hello World! Tag Attribute

29 VoiceXML: tag Hello World! Tag Attribute Value: Name of another form

30 VoiceXML: tag Hello World! I found my second form.

31 VoiceXML: tag Hello World! I found my second form. Attribute

32 VoiceXML: tag Hello World! I found my second form. Attribute Value

33 VoiceXML: tag Hello World! I found my second form. Sounds like…: “Hello World I found my second form.” Sounds like…: “Hello World I found my second form.”

34 Try this in your Scratchpad Hello World! This dialogue goes on and on 1. Guess what this script will do. 2. Edit Scratchpad 3. Call 1-877-500-8965 1. Guess what this script will do. 2. Edit Scratchpad 3. Call 1-877-500-8965

35 VoiceXML: Form Blocks

36 VoiceXML: Form Blocks

37 VoiceXML: Form Blocks Attribute

38 VoiceXML: Form Blocks Attribute Value

39 VoiceXML: Form Blocks Attribute Value

40 VoiceXML: Form Blocks Do you like computers? New “prompt” tag: child of “field”

41 VoiceXML: Form Blocks Do you like computers? Text to Speech: “Do you like computers?” Text to Speech: “Do you like computers?”

42 VoiceXML: Form Blocks Do you like computers? New “filled” tag: child of “field”

43 VoiceXML: Form Blocks Do you like computers? Great, I got your answer. Text to Speech: “Great, I got your answer” Text to Speech: “Great, I got your answer”

44 VoiceXML: Form Blocks Do you like computers? Great, I got your answer. Broken!

45 VoiceXML: Form Blocks Do you like computers? Great, I heard your answer. Broken!

46 VoiceXML: Form Blocks Do you like computers? Great, I got your answer. Broken!

47 VoiceXML: Form Blocks Do you like computers? Great, I got your answer. Since the predefined boolean grammar isn’t working, we’ll add one ourselves

48 VoiceXML: Form Blocks Do you like computers? 1 2 Great, I got your answer. Press 1 or 2, record the answer Copy and paste this to receive any “1 or 2” input

49 VoiceXML: Form Blocks Do you like computers? 1 2 Great, I got your answer.

50 VoiceXML: Form Blocks Input type will be a touch tone keyboard

51 VoiceXML: Form Blocks Reference some touch tone input gathering code

52 VoiceXML: Form Blocks A grammar can have many rules In this example, when this grammar is used, it should start with the rule named “top” A grammar can have many rules In this example, when this grammar is used, it should start with the rule named “top”

53 VoiceXML: Form Blocks “one-of” tag: user specifies one of the following items

54 VoiceXML: Form Blocks The allowable items are “1” and “2”

55 VoiceXML: Form Blocks Text to Speech: “Great, I got your answer” Text to Speech: “Great, I got your answer”

56 VoiceXML: Form Blocks Try this!

57 Do you like computers? 1 2 Great, I got your answer. VoiceXML: Form Blocks Now let’s do something with the input after it’s identified

58 Do you like computers? 1 2 Great, I got your answer. VoiceXML: Form Blocks

59 Do you like computers? 1 2 Great, I got your answer. I'm glad you like computers. Too bad that you don't like computers. VoiceXML: Form Blocks

60 Do you like computers? 1 2 Great, I got your answer. I'm glad you like computers. Too bad that you don't like computers. VoiceXML: Form Blocks “if-else” tag: Special two-part tag: 1.The if part 2. The else part “if-else” tag: Special two-part tag: 1.The if part 2. The else part

61 Do you like computers? 1 2 Great, I got your answer. I'm glad you like computers. Too bad that you don't like computers. VoiceXML: Form Blocks If some condition is met, do what follows here Otherwise, do what follows here

62 Do you like computers? 1 2 Great, I got your answer. I'm glad you like computers. Too bad that you don't like computers. VoiceXML: Form Blocks The “if” tag has a “cond” condition attribute The condition here is that the “likeComputers” field is filled with the value “1”

63 Do you like computers? 1 2 Great, I got your answer. I'm glad you like computers. Too bad that you don't like computers. VoiceXML: Form Blocks Notice the double “==“

64 Do you like computers? 1 2 Great, I got your answer. I'm glad you like computers. Too bad that you don't like computers. VoiceXML: Form Blocks If the condition is true, say this.

65 Do you like computers? 1 2 Great, I got your answer. I'm glad you like computers. Too bad that you don't like computers. VoiceXML: Form Blocks If the condition is not true, say this

66 Do you like computers? 1 2 Great, I got your answer. I'm glad you like computers. Too bad that you don't like computers. VoiceXML: Form Blocks [If time in class]: Try it! (might want to download the slides and copy and paste from them, but you’ll have to fix up the quotes) [If time in class]: Try it! (might want to download the slides and copy and paste from them, but you’ll have to fix up the quotes)

67 VoiceXML Homework In this homework you have two options (extra credit: do both!): 1.Use the prompt/grammar/filled children of the field tag to ask a question. Modify what we’ve done to accept more than “1” and “2” as input, and have the computer say something different in response to each one 2.Use the prompt/grammar/filled children of the field tag to ask a question. Then, if the user inputs a “1”, have the computer repeat a phrase forever. If the user inputs a “2”, just have the computer say one thing. Add a tiny bit of text to your webpage with your Developer ID & pin so that we can listen. Also send Ken (Kenneth.Church@jhu.edu) and me (annirvine@gmail.com) an email with the contents of your Scratchpad. Due Tuesday, February 22 nd before sunrise.

68 Hint for Option #1 1.Use the prompt/grammar/filled children of the field tag to ask a question. Modify what we’ve done to accept more than “1” and “2” as input, and have the computer say something different in response to each one I'm glad you like computers. Too bad that you don't like computers. I'm glad you like computers. Too bad that you don't like computers. =

69 Hint for Option #2 2.Use the prompt/grammar/filled children of the field tag to ask a question. Then, if the user inputs a “1”, have the computer repeat a phrase forever. If the user inputs a “2”, just have the computer say one thing. I hope you’ll like computers forever Too bad that you don't like computers. and ever + +

70 Another Hint for Option #2 2.Use the prompt/grammar/filled children of the field tag to ask a question. Then, if the user inputs a “1”, have the computer repeat a phrase forever. If the user inputs a “2”, just have the computer say one thing. … … Note that your single code can include multiple forms

71 More Advanced Phone Programming

72 Welcome to the fruit picker. apple out.fruit = "apple"; orange out.fruit = "orange"; pear out.fruit = "pear"; Pick a fruit. Please pick a fruit. You picked

73 Welcome to the fruit picker. apple out.fruit = "apple"; orange out.fruit = "orange"; pear out.fruit = "pear"; Pick a fruit. Please pick a fruit. You picked

74 Welcome to the fruit picker. apple out.fruit = "apple"; orange out.fruit = "orange"; pear out.fruit = "pear"; Pick a fruit. Please pick a fruit. You picked

75 Welcome to the fruit picker. apple out.fruit = "apple"; orange out.fruit = "orange"; pear out.fruit = "pear"; Pick a fruit. Please pick a fruit. You picked

76 Welcome to the fruit picker. apple out.fruit = "apple"; orange out.fruit = "orange"; pear out.fruit = "pear"; Pick a fruit. Please pick a fruit. You picked

77 Welcome to the fruit picker. apple out.fruit = "apple"; orange out.fruit = "orange"; pear out.fruit = "pear"; Pick a fruit. Please pick a fruit. You picked

78 Welcome to the fruit picker. apple out.fruit = "apple"; orange out.fruit = "orange"; pear out.fruit = "pear"; Pick a fruit. Please pick a fruit. You picked

79 Welcome to the fruit picker. apple out.fruit = "apple"; orange out.fruit = "orange"; pear out.fruit = "pear"; Pick a fruit. Please pick a fruit. You picked Major Components: 1.Block introduction 2.Field for user input 3.Grammar 4.Prompt 5.Filled (6. catch) Major Components: 1.Block introduction 2.Field for user input 3.Grammar 4.Prompt 5.Filled (6. catch)

80 Welcome to the fruit picker. apple out.fruit = "apple"; orange out.fruit = "orange"; pear out.fruit = "pear"; Pick a fruit. Please pick a fruit. You picked Grammar: Speech Recognition, not Touch Tone like before Grammar: Speech Recognition, not Touch Tone like before

81 Welcome to the fruit picker. apple out.fruit = "apple"; orange out.fruit = "orange"; pear out.fruit = "pear"; Pick a fruit. Please pick a fruit. You picked Grammar: Three possible answers: Apple, Orange, Pear Grammar: Three possible answers: Apple, Orange, Pear

82 Welcome to the fruit picker. apple red out.fruit = "apple"; orange out.fruit = "orange"; pear out.fruit = "pear"; Pick a fruit. Please pick a fruit. You picked Grammar: For Apple can say “apple” or “red” Grammar: For Apple can say “apple” or “red”

83 Welcome to the fruit picker. apple red out.fruit = "apple"; orange out.fruit = "orange"; pear out.fruit = "pear"; Pick a fruit. Please pick a fruit. You picked Filled: Repeats the input that is heard Filled: Repeats the input that is heard

84 Welcome to the fruit picker. apple red out.fruit = "apple"; orange out.fruit = "orange"; pear out.fruit = "pear"; Pick a fruit. Please pick a fruit. You picked No match with Grammar or No input at all: “Please pick a fruit” No match with Grammar or No input at all: “Please pick a fruit”

85 More Advanced Phone Programming: Full example with even more bells and whistles here: https://studio.tellme.com/vxml2/ref/elements/prompt.html https://studio.tellme.com/vxml2/ref/elements/prompt.html


Download ppt "Student Pages"

Similar presentations


Ads by Google