Quiz using Dialogue System with questions of type Rank Order Scaling

Announcements, support questions, and discussion for the Dialogue System.
bhavinsavajiyani
Posts: 42
Joined: Sun Jul 26, 2020 3:51 pm

Re: Quiz using Dialogue System with questions of type Rank Order Scaling

Post by bhavinsavajiyani »

Hello!
Thank you so much for giving the insights.
Based upon what you said, I do have a conversation set up. My conversation does begin with the first question, based upon the workflow given below.

My Conversation is created using this same conversation template.
My Conversation is created using this same conversation template.
assignIntegers.png (37.25 KiB) Viewed 671 times

Now, in the same conversation, how do I move to next question? The conversation above, contains 1 question, with four options, looping till integers are assigned. I have created one variable called "order", with initial value of 1. In script section of every response, variable order is being incremented by 1. At the NPC Node (Node: "Assign Integer" in this case), I have added a condition: Variable["order"] <= 4. This is currently looping as intended, but now, I want to move to next question, after an integer is assigned to every response. Also, I have a situation, where I require 2 extra buttons(clear and submit buttons), which need to be activated/displayed, only after every response is assigned an integer. Clear button, would clear all the assigned integers to responses of that question, and at that instance, player has to loop through same question, again. Only after an integer is assigned to every response for that particular question again, those two extra buttons (clear and submit) get activated again. And Only after submit button is pressed, the conversation should proceed to next question.

Now, when next question is displayed, the variable "order" needs to be reset again, so that an integer could be re-assigned, for every new response which came with next question. The cycle of looping through all options, needs to be played, and once every response (4 responses in our case) is allocated an integer, then clear and submit buttons get activated/displayed again. On pressing clear button, the allocated integer next to every response needs to be reset, and the same question needs to be shown, where looping for assigning integers must once again take place, and once every response is assigned an integer, the clear and submit buttons need to be displayed again. And when submit button is pressed, the conversation should proceed to next question indeed.
This chain must go on, for about 100 questions.

Is there any dynamic way of implementing the quiz, for large number of questions, with each question having 4 unique options? It could help a lot, if questions, along with their options could be loaded dynamically, at runtime, displayed in same manner, where the cycle of assigning the integer needs to take place and on clicking submit button, content for next question and it's relevant responses, gets fetched from external resource. New question is displayed again, and same process goes on, till all questions are covered and conversation ends.

Tony Li wrote: Sat Oct 10, 2020 9:45 am Alternatively, you can consider reading the questions and answers from an external source, and filling it in at runtime. Add a script to the Dialogue Manager that has OnConversationLine and OnConversationResponseMenu methods. (See Script Methods.) Rough example:

Code: Select all

void OnConversationLine(Subtitle subtitle)
{
    subtitle.formattedText.text = // get question text from external source
}
void OnConversationResponseMenu(Response[] responses)
{
    for (int i = 0; i < 4; i++)
    {
        responses[i].formattedText.text = // get answer text for answer i from external source
    }
}
You mentioned this, but I'm not able to get it, in what manner should I use this? Like, should I create a new script, which just contains those two methods and attach it to Dialogue Manager? Are there any other things, connected to doing that, which might be required, in order for that to work as required? Or would addition of script on Dialogue Manager alone, would work?


Also, I wanted to know, if there was a way by which the questions and their relevant responses, created in Dialogue System Database's conversation, could be referenced/used, outside of Dialogue System, as I need to record player responses, and have to send them to external server.
Group of 1 Question (question number and it's content), and it's 4 responses (along with integer assigned next to every response and content of every responses).
Such groups for all questions(~100), need to be recorded and sent to server.
How can I record data of such groups? As I might need references of such groups, for every question, outside of the Dialogue System, for future use, at the time of sending the data to server. Is there any way by which this could be done?

Apologies for the inconvenience, but I am yet not able to create such a functionality. I have tried various ways, and it's been daunting/overwhelming as a beginner, even after referring to documentation.
I'm trying to implement what you've suggested throughout, and I can't thank enough, for support which I've received from your end. It is due to the help I've received, that I have a partial system, running as intended.

Any help regarding how to progress ahead, might do wonders!
Your help would be much appreciated.
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quiz using Dialogue System with questions of type Rank Order Scaling

Post by Tony Li »

Hi,

Since you mentioned this:
bhavinsavajiyani wrote: Sun Oct 18, 2020 1:42 pmIs there any dynamic way of implementing the quiz, for large number of questions, with each question having 4 unique options?
I recommend trying to get this working instead of focusing on the questions you asked before that. The code that I provided is an example of how to structure your script. But you will need to figure out and write that script. It will probably be best to put it on the Dialogue Manager.
bhavinsavajiyani wrote: Sun Oct 18, 2020 1:42 pmAlso, I wanted to know, if there was a way by which the questions and their relevant responses, created in Dialogue System Database's conversation, could be referenced/used, outside of Dialogue System, as I need to record player responses, and have to send them to external server.
Yes. Since you will be managing a conversation in a script that you will write, use that script to also send responses to the external server. However, I recommend saving this until later. Make the conversation work locally first.
bhavinsavajiyani
Posts: 42
Joined: Sun Jul 26, 2020 3:51 pm

Re: Quiz using Dialogue System with questions of type Rank Order Scaling

Post by bhavinsavajiyani »

Hello.
Thank you very much for reverting back. I do know that I would have to create custom workflow, based upon the given situation.
Tony Li wrote: Sun Oct 18, 2020 4:12 pm I recommend trying to get this working instead of focusing on the questions you asked before that. The code that I provided is an example of how to structure your script. But you will need to figure out and write that script. It will probably be best to put it on the Dialogue Manager.
I would surely be working as per the suggestions provided.

But do you have any thoughts on how can I approach, to make the conversation progress to next question?
I have created two buttons, clear and submit, which are not a part of Response Menu, but I have placed them under Response Menu UI.
How can I sync them with the ongoing conversation, to be activated only when last response of the question is clicked and then conversation should not progress, until submit button is pressed?
Should I include those two buttons (clear and submit), as response buttons?
bhavinsavajiyani wrote: Sun Oct 18, 2020 1:42 pm Hello!
Thank you so much for giving the insights.
Based upon what you said, I do have a conversation set up. My conversation does begin with the first question, based upon the workflow given below.

Conversation Template
Conversation Template
assignIntegers.png (37.25 KiB) Viewed 663 times

Now, in the same conversation, how do I move to next question? The conversation above, contains 1 question, with four options, looping till integers are assigned. I have created one variable called "order", with initial value of 1. In script section of every response, variable order is being incremented by 1. At the NPC Node (Node: "Assign Integer" in this case), I have added a condition: Variable["order"] <= 4. This is currently looping as intended, but now, I want to move to next question, after an integer is assigned to every response. Also, I have a situation, where I require 2 extra buttons(clear and submit buttons), which need to be activated/displayed, only after every response is assigned an integer. Clear button, would clear all the assigned integers to responses of that question, and at that instance, player has to loop through same question, again. Only after an integer is assigned to every response for that particular question again, those two extra buttons (clear and submit) get activated again. And Only after submit button is pressed, the conversation should proceed to next question.

Now, when next question is displayed, the variable "order" needs to be reset again, so that an integer could be re-assigned, for every new response which came with next question. The cycle of looping through all options, needs to be played, and once every response (4 responses in our case) is allocated an integer, then clear and submit buttons get activated/displayed again. On pressing clear button, the allocated integer next to every response needs to be reset, and the same question needs to be shown, where looping for assigning integers must once again take place, and once every response is assigned an integer, the clear and submit buttons need to be displayed again. And when submit button is pressed, the conversation should proceed to next question indeed.
This chain must go on, for about 100 questions.
I have also created a custom script which would be listening for on-click events for response buttons, and would assign the value of order variable, to the text component of each response button which is clicked. The value of order also gets incremented by 1, as intended and I now have the first question, looping through all options, as intended. But I'm unable to figure out how to move to next question, in the same conversation.
Any suggestions on how to proceed with that?

Your help is much appreciated!
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quiz using Dialogue System with questions of type Rank Order Scaling

Post by Tony Li »

Hi,

Here is an example:

bhavin1.png
bhavin1.png (37.27 KiB) Viewed 661 times

Add Clear and Submit as response nodes.

The Submit node's Conditions should require that the user has assigned all four A - D. Otherwise it will not be available in the response menu.

The Clear node's Script field can clear the user's current assignments.
bhavinsavajiyani
Posts: 42
Joined: Sun Jul 26, 2020 3:51 pm

Re: Quiz using Dialogue System with questions of type Rank Order Scaling

Post by bhavinsavajiyani »

Hello Sir.

Thank you so much for suggesting the logic!
It is no less than a wonder... And it does indeed work like a charm!
:D

That is definitely working as intended, except for the fact that both, submit and clear buttons have a different UI, than the other 4 response buttons.
Currently, when clear and submit buttons are reached, they are being displayed as responses, at the position of 1st and 2nd options of the question.
I have placed clear and submit buttons (both buttons have unique UI), at specific positions on a world canvas, different from 4 regular response buttons.
Is there any way by which the UI for clear and submit buttons, get displayed as they are, at their original positions on world canvas, and not displayed as options of the question?

Apologies for all the inconveniences and I can't thank you enough for all the help that you have provided.
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quiz using Dialogue System with questions of type Rank Order Scaling

Post by Tony Li »

Hi,

Add StandardUIResponseButton components to the Submit and Clear buttons.

Assign the Submit and Clear buttons to the StandardUIMenuPanel component's Buttons list. They will have indices 0 and 1.

Then change the Submit dialogue entry's text to: "Submit [position=0]". This will make it use button 0 in the Buttons list.

Change the the Clear dialogue entry's text to: "Clear [position=1".
bhavinsavajiyani
Posts: 42
Joined: Sun Jul 26, 2020 3:51 pm

Re: Quiz using Dialogue System with questions of type Rank Order Scaling

Post by bhavinsavajiyani »

Hello Sir.

I'm sorry, but I'm not able to get your point.

I had already assigned Standard UI Response Button script to both, clear and submit buttons.
Currently, the size of button list of my Standard UI Menu Panel is 6, where I have first passed regular 4 response buttons, all of which have identical UI, at first 4 positions of the list (Element 0-Element 3 of button list). Next, at Element 4, I have passed Clear Button and at Element 5 of the list, I have passed Submit button.

Now, based upon what you suggested above, I also changed Dialogue Text of Submit Button, in the conversation, to Submit [position=5].
But that does not display submit button at all.
bhavinsavajiyani
Posts: 42
Joined: Sun Jul 26, 2020 3:51 pm

Re: Quiz using Dialogue System with questions of type Rank Order Scaling

Post by bhavinsavajiyani »

Hello Sir...

That indeed worked now.
That worked the way you had suggested above, but what that does is, when submit button is reached, all the 4 response buttons disappear.

Is there any way by which all those 4 response buttons remain intact, and the clear and submit buttons get displayed, at the same instant, with their respective UI?
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quiz using Dialogue System with questions of type Rank Order Scaling

Post by Tony Li »

Inspect the Dialogue Manager. Tick Input Settings > Include Invalid Entries. This will show buttons 1-4 in a non-clickable state if they've already been used.
bhavinsavajiyani
Posts: 42
Joined: Sun Jul 26, 2020 3:51 pm

Re: Quiz using Dialogue System with questions of type Rank Order Scaling

Post by bhavinsavajiyani »

Thank You so much!
It works like charm.
Post Reply