How to build the Quiz Bot

Once you understand the flowchart above, it is quite straight-forward to go for the intent definitions.

Default Welcome intent

The default welcome intent can be triggered using both a Welcome event as well as the Start over phrase.

answer1.correct

This is the intent definition for the case where the user answers the first question correctly.

answer1.incorrect

If the user provides an incorrect response for question 1, we handle it using the wildcard entity. Type out any phrase (I have used “something else”), press Enter, mark the whole training phrase as @sys.any wildcard entity, and ignore the warning.

answer2.correct

Follow a similar pattern to answer1.correct intent for when user answers question 2 correctly.

answer2.incorrect

Now follow the same approach for the incorrect answer for question 2.

answer3.correct

This is the intent definition for when user answers the 3rd question correctly. Note that there is a suggestion chip with the text “Start over”, which allows the user to retake the quiz.

answer3.incorrect

Use the previous pattern (that you used for the incorrect answers) for the incorrect answer for question 3.

That’s it. You should now have a bot which behaves as shown in the demo video.

>