4.3 Let's Chat

4-3 User Input

OBJECTIVES

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

TEACHER RESOURCES:

Standards

    • CSTA 2-AP-13: Decompose problems and subproblems into parts to facilitate the design, implementation, and review of programs.

CSTA

Do Now (5 minutes)

Do Now Diversity in Technology (5 minutes)

    1. Watch "What are Chatbots?" (1:50)

    2. 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:

Mini-Lesson (5-10 minutes)

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)


Project (20-30 minutes)

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?

Close-Out (5 minutes)

Close-Out (5 minutes)

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?

Potential Responses

  • 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.