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

Quiz using Dialogue System with questions of type Rank Order Scaling

Post by bhavinsavajiyani »

Hello!
I have been Dialogue System and it is a very great asset, with tons of features! :D
I am a beginner programmer though, and sometimes, even small things could get overwhelming and complicated. Therefore, apologies for silly doubts.
Noob alert ahead!

I have a situation where I require to implement a quiz, consisting of several number of questions. For ordinary MCQ based Quiz, with only 1 correct answer, is something which works almost readily, with Dialogue System.
But in this case, I need to implement a quiz, with questions of type Rank Order Scaling. Each question would consist 4 options. But the catch here is, that there is NO single answer to any question. I need the player, to rank each of the 4 options of every question, on a scale of 1-5 and for each given question, the ranks should not be repeated.

Also, I wanted to know, whether we can provide only "Textual Content", as responses. Like, each question would be having 4 options. Each question would be displayed in NPC Panel. But the 4 options for each question I suppose, would be a part of Response Menu Panel. The textual content of each of my options, could involve multiple lines with a decent amount of characters, and therefore I don't think that it would visually look good, if I place large pieces of texts, on a button. Therefore, I require the 4 options of each question, to be normal textual objects. And then, for ranking of each options, I am looking forward to place a small button, in parallel to each option. Now there could be multiple ways for ranking to be implemented.

One of them is dropdown, where we could have 4 dropdown buttons next to 4 options, each dropdown button corresponding to the respective option. The lists of dropdown would consist of numbers from 1-5. Player can choose any rank out of it, and repeat the process of selection, for all four options. But none of the rank should be repeated, in a single question, and player cannot proceed ahead without ranking of every option in the given question.

Another method could be, placing 4 regular buttons next to 4 options, where each button corresponds to respective option. Initially, none of the button is displaying any text. All of them would be blank. Then, when any button, out of the four buttons is clicked, integer '1' gets displayed on the button which was clicked. Similarly, when next button is clicked, integer '2' gets displayed on the button which was clicked 2nd. In short an integer starts from 1, corresponding to the button which was clicked first, and its value gets incremented, when next button out of remaining buttons is clicked. When all 4 buttons have been clicked, they would be displaying ranks. No ranks could be repeated in a single given question and player should not be able to progress, unless each option has been ranked in a given question.


Non Functional, Skeleton Template for visual reference of stuff which I'm looking forward to implement.
Non Functional, Skeleton Template for visual reference of stuff which I'm looking forward to implement.
SkeletonTemplate.png (159.33 KiB) Viewed 596 times



Rank Order Question Type
Rank Order Question Type
RankOrderQuestion.png (200.52 KiB) Viewed 596 times


Once that is done, I also need to store the ranks against their corresponding options, for every question, in the database.
Is there any possible way of how to implement the given scenario?

Any help would be much appreciated!

Kind Regards,
Bhavin!
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 Bhavin,

You can probably define those types of questions in your dialogue database. Use custom fields in your dialogue entries to store information about whether an answer is correct, or its rank, etc.

But you will need to write custom UIs to handle the UI part. Explaining how to write custom UIs is outside the scope of the Dialogue System. You can make subclasses of StandardDialogueUI, StandardUISubtitlePanel, and StandardUIMenuPanel, and/or hook into various events such as OnConversationLine and OnConversationResponseMenu.
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 for the suggestions. And your help is much appreciated! :D
I suppose you guys have already created a template, for regular quiz. I have downloaded that, from the extras section.

Obviously, a lot of different people might be using Dialogue System for developing various sorts of masterpieces, and Quiz is something, which many people would be utilizing in their workflows.
Just a suggestion though, that it would really be a great help, if you could create a variant of such Quiz templates, with different types of Questions!
Obviously, only if it's possible.

Because you guys seem to have great expertise in the relevant field, and obviously you guys are masters of your craft.
But sometimes, especially for beginners, it becomes overwhelming for creating custom workflows.

You guys have always answered all the queries and I really appreciate those efforts. That's something which has left a huge, positive impact on progress of workflows of various people! :D
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,

Glad to help! Maybe in the future I'll develop a separately-priced quiz addon. But I don't currently have plans to do that.

If you have specific questions about the Dialogue System API (Scripting & API), just let me know.
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!

While setting up the conversation in the Dialogue System Database, we can create multiple nodes of NPC and Player, in a conversation.
By default, if any of the nodes, are end nodes (nodes which are not connected to any other nodes), then the conversation ends once the respective node is executed.

I have a situation, where I have 4 response buttons. In the Conversation tab of Dialogue System database, I have created a conversation, which has one NPC node, linked directly to the default start node. Then, the NPC node links to 4 separate nodes. The 4 nodes with which NPC is connected to, contain responses. That is it. The conversation contains only that much. One NPC, connected to 4 responses!

Now, I require an integer to be displayed, on the button which is clicked. I am looking forward to create a function, that would be responsible for displaying the integer. I am looking forward to pass the above created function, to “OnClick()” of every response button I have created, 4 response buttons in this case.

When the first question is displayed, the player would be provided 4 options. The conversation should not proceed ahead at that instance, and player should click on every response button, in order for the integers to be displayed, which would be generated when button is clicked.
Only after all 4 options have an integer assigned to them, a submit button would be activated. I have created a submit button, which would appear only after every response has an integer assigned to it!
When the submit button is clicked, then the conversation should progress ahead, and next question should be displayed!
This sequence should be repeated, until the list of questions have ended!

Currently, when any of the response button is clicked, the conversation ends.
Is there any way by which, I could prevent the conversation to end?
I require the conversation to be completed, only when every response button, for every question, has been clicked.

Any help would be much appreciated.

Kind Regards,
Bhavin!
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 Bhavin,

Link the response nodes back to the NPC node using an intermediate, empty node with Sequence set to None() (or Continue() if you're using continue buttons). Set Conditions on the response nodes to require that fewer than 4 integers have been assigned:

assignIntegers.png
assignIntegers.png (37.25 KiB) Viewed 555 times
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 »

That makes sense.
Thank You very much for helping out! :D
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 »

Glad to help!
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 »

Hey!
I really appreciate your help. And apologies for the trouble, but I'm stuck again.

As per your suggestion, I did what you mentioned above.
Tony Li wrote: Sun Oct 04, 2020 10:20 am Hi Bhavin,

Link the response nodes back to the NPC node using an intermediate, empty node with Sequence set to None() (or Continue() if you're using continue buttons). Set Conditions on the response nodes to require that fewer than 4 integers have been assigned:
assignIntegers.png
assignIntegers.png (37.25 KiB) Viewed 536 times
While testing it in my scene, it gives a feeling of conversation being refreshed, after each response button is pressed. When any of the response button is clicked for the first time, then after the click, there's some delay, and then the responses get displayed again. Visually, it gives a feeling of things being refreshed. Is there any way by which, this could be resolved?

Also, I have a situation, in continuation with the ongoing functionality that I'm trying to implement.
As mentioned in threads above, I am looking forward to set a rank order type quiz, where I have about 100 questions. At a time, only one question needs to displayed. Each question has 4 options, but in order to proceed to the next question, player needs to click on each given option (4 options), before they can proceed to next question. Please note that there is no specific order in which the 4 response buttons for a given question, need to be clicked. Any button out of all 4 response buttons, could be clicked.

Now, for the given question, when any of the response button is clicked for the first time, an integer, starting from value=1, is displayed on the button, and the button which was clicked, cannot be clicked again. Next, when any of the remaining 3 responses for the ongoing question is clicked, value of integer gets incremented by 1 and the incremented value, is displayed on the button and the button which was clicked, would not be intractable.
This is repeated until all 4 response buttons for the given question, have been clicked.
Now, I have created 2 buttons (a clear choices button - which would reset the integer values/ranks being displayed on the button, for the given question and make them enable/intractable again, and a submit button, which when clicked, would display next question, with relevant responses), which would only be activated, once the fourth response button for the given question is clicked.
The clear & submit buttons, would only be available, when all the responses for a given question, have been clicked and assigned the ranks. When next question is displayed, the clear and submit buttons would only be available, after all 4 responses of that question have been clicked. This cycle would go on, until all the questions are completed!

And I also wanted to know, if there was any better way, to create such a conversation which involves such large number of questions. Like, I have about 100 questions and the number of questions might increase or decrease in future. Creating such a structure for 100 questions in the single conversation, would increase the overall complexity! You guys are masters of your craft. Is there any dynamic approach, which could be used for the above mentioned workflow?
Apart from that, I also need the ability to store the ranks(integer) next to each option, along with the content of each option, for every given question. Like I need to send the responses provided by the player, for each question, to the server.
1 Question - 4 options along with their ranks for that questions. Same things for all the questions (~100), are need to be recorded and sent to server. Is there any way to do such a thing?

At the moment, I am confused :? & unclear about how to do that, and any help would be much appreciated.

Kind Regards,
Bhavin
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 Bhavin,

I recommend breaking it down into small parts. Get each part working individually.
bhavinsavajiyani wrote: Sat Oct 10, 2020 6:30 amWhile testing it in my scene, it gives a feeling of conversation being refreshed, after each response button is pressed.... Is there any way by which, this could be resolved?
Try setting the "Assign integers" node's Sequence to: None()
bhavinsavajiyani wrote: Sat Oct 10, 2020 6:30 amEach question has 4 options, but in order to proceed to the next question, player needs to click on each given option (4 options), before they can proceed to next question. Please note that there is no specific order in which the 4 response buttons for a given question, need to be clicked. Any button out of all 4 response buttons, could be clicked. [etc.]
Add a fifth node whose link has "Below Normal" priority. This node will only be used if none of the response button nodes' Conditions are true.

When you reset the variables and the number of answers clicked, call DialogueManager.UpdateResponses(). This will update the current response menu to reflect each node's Conditions.
bhavinsavajiyani wrote: Sat Oct 10, 2020 6:30 amAnd I also wanted to know, if there was any better way, to create such a conversation which involves such large number of questions. Like, I have about 100 questions and the number of questions might increase or decrease in future.
I recommend getting everything above working first. It will give you a better understanding of how the Dialogue System works.

Once that works solidly -- and after you are confident you understand how it all works so far -- then you can decide whether it would be better to write the conversations in the Dialogue Editor or pull their text from an external source. Keep in mind that you can link from one conversation to another. For example, you could put 10 questions in each conversation. When you get to the 10th conversation, inspect the last node. From the "Links To:" menu, select "(Another Conversation)".

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
    }
}
Post Reply