Q and A quiz in dialogue manager.

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
HaiiroMukuro
Posts: 80
Joined: Sun Jul 17, 2016 3:38 pm

Q and A quiz in dialogue manager.

Post by HaiiroMukuro »

I'm making a Q and A dialogues in dialogue manager.
Here's an example.
1. What is my age?
a. 12 //wrong answer
b. 18 // right answer
c. 25 // wrong answer
d. 20 // wrong answer.
2. What is my favorite book?
a. My Teen Romantic Comedy is Wrong as I expected. //right answer
b. Batman // wrong
c. Harry Potter // wrong
d. Twilight // wrong
3. My favorite TV series.
a. OnePunch Man //wrong
b. Pokemon // wrong
c. How I met your mother. // wrong
d. Flash // right
4. What is my favorite game.
a. Last of Us. //wrong
b. Left 4 Dead. //wrong
c. League of Legends. //right
d. No Man's Sky. // wrong
---
What I mean is, the dialogue manager records the right and wrong answers and will show the result after the Q and A.
The dialogue will say "Out of (int) questions, you got (int) right answers and (int) wrong questions."
If the player gets 1/4 or 2/4 right answer/s. The player will start again. else the player will finish the Q and A.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Q and A quiz in dialogue manager.

Post by Tony Li »

Hi,

Try these steps:

1. Define two variables: Right and Wrong. Set their Types to Number.

2. In the right answers, set the Script field to:

Code: Select all

Variable["Right"] = Variable["Right"] + 1
(You can use the Lua wizard or just paste it in manually.)

3. In the wrong answers, set the Script field to:

Code: Select all

Variable["Wrong"] = Variable["Wrong"] + 1
4. Add this dialogue entry at the end:
  • Dialogue Text: "Out of 4 questions, you got [var=Right] right answers and [var=Wrong] wrong questions."
5. Link that entry to two child entries:
  • Dialogue Text: "Out of 4 questions, you got [var=Right] right answers and [var=Wrong] wrong questions."
    • Dialogue Text: "We'll start the quiz again."
    • Conditions: Variable["Right"] <= 2
    • Link to the beginning of the conversation.
    • Dialogue Text: "Good job!" [END]
    • Conditions: Variable["Right"] > 2
Post Reply