Reputation: 1885
I am trying to create a quiz-bot, in which I wish to verify the users answers. I have created an intent to show questions and then a follow up intent to verify answers. Following is the brief idea:
When the user is shown the question, he/she is also shown the one word options as suggestion tiles, the user selects the suggestion tile (which he/she thinks is a correct answer), then the follow up intent should be triggered to verify the answer and the bot should respond as correct or incorrect answer.
As of now, I am able to show the question and options in the chat box, but as soon as the user selects the option, default fallback intent is triggered. Also I have included all the answers in the intent's training and these answers are of one word length.
Is there a way to trigger intent using user's input? Also if there is any other approach to create quiz-bot in dialogflow, please do comment?
Upvotes: 0
Views: 426
Reputation: 732
I have also created a quiz on Google home. The same problem occurred to me and I came up with the following solution:
The Default Welcome Intent has an output context of await_answer and I ask the question in this intent. Then there is the getAnswerIntent that has the await_answer as input context and has the answerCodeEntity as trainingsphrase. This entity consists of:
A: 1, A, answer 1, answer A, first, first one, the first one
B: 2, 2nd answer, second answer, answer B, B, ...
C: ...
D: ...
E.g.: How far away is the moon from the earth? A: 384.000km B: 50.000km or C: 1.000.000 km
This way users know how to answer. You will avoid having users that can't say the answer or just don't remember. Always try to expect how a user will respond.
This way you can handle the user's answer in the getAnswerIntent.
I hope this helps you!
Upvotes: 2