11. Capturing Name

People feel happy when you call their name. So do students.

The Problem

What's wrong with the below conversation we mentioned for the previous session, again?

Example 1

  • Cell 1
    • My name is *
    • <strong/>what is your name
    • Nice to meet you!
  • Log 1
    • Hello! My name is Aco. What's your name?
    • My name is Jack.
    • Nice to meet you!

A more natural answer is "Nice to meet you, Jack!" How could we achieve that?

The Solution

You need <s/> element to call the name. If you haven't, check BrainXML reference for more information on s element. In short, it returns the text that the corresponding input-side star (*) represents.

The below are the improved cell and example chat logs.

Example 2

  • Cell 2
    • My name is *
    • <strong/>what is your name
    • Nice to meet you, <s/>!
  • Log 2
    • Hello! My name is Aco. What's your name?
    • My name is Jack.
    • Nice to meet you!
  • Log 3
    • Hello! My name is Aco. What's your name?
    • My name is Marry.
    • Nice to meet you, Marry!

As you might have found, the above cell returns whatever following "My name is" as the name. Again this is an easy but not so reliable solution for capturing name. So, use with care and keep reading for better solutions!

Obviously we can use * and <s/> to capture not only name but also age, gender, location, and so on.

Things to Keep in Mind

  • Calling students' name makes them happy :-)
  • To do so you may use * as the placeholder for name and use <s/> to return the name.