Page 1 of 1

Q and A quiz in dialogue manager.

Posted: Tue Aug 30, 2016 5:16 am
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.

Re: Q and A quiz in dialogue manager.

Posted: Tue Aug 30, 2016 9:29 am
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