4-3 User Input
OBJECTIVES: By the end of this lesson, students will:
gain experience with Ask, Answer and Join blocks.
used Repeat until block , to validate input
realize that using open-ended responses and phrases from the input, tricks the user into believing the Chatbot understands more than it does.
Click on Character to chat.
Demo
CSTA 2-AP-13: Decompose problems and subproblems into parts to facilitate the design, implementation, and review of programs.
Do Now Diversity in Technology (5 minutes)
Watch "What are Chatbots?" (1:50)
Discuss:
What are chatbots used for
What are the differences between the two types of chatbots mentioned?
How do chatbots get more intelligent over time?
TEACHER GUIDANCE:
New blocks introduced today are:
Use Slides; Slides 3 - 12. or Wraparound slides : User input, slides 18-28
Outcomes
Students should
understand the ask/Answer Pair.
realize that answer stores the user input as text .
that this text can be added to strings using the join command.
Spicy concepts:
Repeat until is a good control structure for checking input validation.
You can check any string text to see if it contains a particular letter. ( Boolean return)
Students choose a backdrop and sprite, and create a project that the user can converse with.
Challenge: How many questions before the user realizes that it is conversing with a dumb chatbot, not a person or AI?
Discuss the following questions:
What gets stored in the answer block.
Which block will continue to loop until the condition is met - used for input validation?
The last thing the user types into the dialog box, gets stored in Answer.
"Repeat until" will keep looping until the condition is met, i.e. a valid response is entered.