12. Handling Yes/No

This session demonstrates how to use system nerve and how to set up and process a Yes/No question.

The problem

In the previous sessions, the Tutor asks students for their name and memorizes it. Now we want to start the class by asking "Are you ready?" For the purpose, we created some cells as below.

Example 1.

  • Cell 1
    • myApp areYouReady
    • Are you ready?
  • Cell 2
    • Yes
    • <strong/>are you ready
    • Good. Now let's start Unit 1: My Classroom.
  • Cell 3
    • OK
    • <strong/>are you ready
    • Good. Now let's start Unit 1: My Classroom.
  • Cell 4
    • Certainly
    • <strong/>are you ready
    • Good. Now let's start Unit 1: My Classroom.

...

Hmmm, the problem here is there are endless expressions for Yes - OK, sure, certainly, I'm ready... It's a huge job if we write a cell for each possible expression. What should we do to avoid it?

The Solution

BrainShop provides a system nerve <n>yes</n> for this purpose. This is also an example how you may use system nerve to make your life as brainmaster easier. If you haven't, check BrainXML for more information on n element.

The nerve <n>yes</n> largely presents the most common expression of Yes. With it you may write a single cell to handle virtually any confirmative answers.

  • Cell 2
    • <n>yes</n>
    • <strong/>are you ready
    • Good. Now let's start Unit 1: My Classroom.

Simple, easy, and fast :-)

What if students answer No? Use a * (star) to catch anything that is not Yes.

  • Cell 3
    • *
    • <strong/>are you ready
    • OK but it's time for Unit 1: My Classroom.

In fact, <n>yes</n> is just one of many system nerves you can utilize. To browse the available system nerves, check out BrainNerve Reference

Things to Keep in Mind

  • You may use <n>yes</n> to simplify the process of Yes/No responses to simple question.