How do I make a multi-answer quiz?

1 favourites
From the Asset Store
Comprehensive localization solution for Construct 3 projects, no addons required!
  • > I'm not sure what you mean by "restarting arrays".

    So You know the restart button on the 'End' layout? When you press that it should go back to Quiz layout and back to a qUESTION 1 Also what if The person presses submit and no answers were checked? It should be wrong.How to code?

    Actually I got how to restart

  • Also what if The person presses submit and no answers were checked? It should be wrong.How to code?

    It's up to you to decide how you want to represent that information to the player. As I mentioned above, if you're using the ticks/crosses to indicate the correct answers then it won't always be clear what the user's result was. That's why I suggested using tick/crosses to grade the selections and setting the correct answers text to green, so the user can differentiate between the correct answers and their selections.

  • > Also what if The person presses submit and no answers were checked? It should be wrong.How to code?

    It's up to you to decide how you want to represent that information to the player. As I mentioned above, if you're using the ticks/crosses to indicate the correct answers then it won't always be clear what the user's result was. That's why I suggested using tick/crosses to grade the selections and setting the correct answers text to green, so the user can differentiate between the correct answers and their selections.

    Yeah so tick and cross should be there but i have a text that says you got the answer wrong/right. so right now the text is working. But when i did

    + Answers: [X] Is checked
    -> CorrectandWrong: Set font color to rgbEx(255, 21, 21)
    -> CorrectandWrong: Set text to "Wrong"
    

    the code affected another code that sayas if you got it correct it would say wrong.

  • If I understand you correctly, you want the CorrectandWrong text to display "Wrong" if the user selects an incorrect answer or doesn't select a correct answer. If that is the case then set the text to "Correct" at the start of the function and then set the text to "Wrong" in the conditions where you add 1 to n.

  • If I understand you correctly, you want the CorrectandWrong text to display "Wrong" if the user selects an incorrect answer or doesn't select a correct answer. If that is the case then set the text to "Correct" at the start of the function and then set the text to "Wrong" in the conditions where you add 1 to n.

    Okay. How to add previous button. Do we subtract one from current question?

  • Okay. How to add previous button. Do we subtract one from current question?

    Yes, and then call set question. If you go back to the previous question and replay it you'll also need to revert the score; if you can skip back multiple questions then this will require you to record the result for each question - you could use an extra in column your timer array to do this, then tally the column after updating to calculate the new score.

    BTW, in your file you've got an instance variable NumberOutOf100.Question_No - it's unnecessary, just use the currentQuestion global variable in the displayed text.

  • Hi guys,

    My quiz consists from 10 answers. So, I extended the array and copy/paste 5 additional txt_answers to the layout. However, those 5 are not generating values from the array but are absolute copy of previous ones. It must be very easy to fix but I'm stuck here. May you please help me?

    Many thanks in advance!

  • I'm guessing it's because you haven't changed the txt_answers.no variable for the copy/pasted instances to 6-10.

  • Hi.

    Thank you for the previous answer!

    Based on the project you've shared I'm trying to create a quiz where you have question => options => answers. For example, question "How many colours does flag of this country have?", options would be different countries (10 in my case) and 10 correspondent answers.

    Please have a look:

    drive.google.com/file/d/1l_PnpUj8zU1s7KvM7dF37IrwsQqGRVIy/view

    I'm stuck in 2 very simple (as I thought) things:

    1.Please look on event sheet line 10/11 (now disable action) - I want txt_answerNew with relevant instance variable No. to be visible after OK button is pressed. But instead, all txt_answerNew become visible. Why? How to fix it?

    2. In line 8 there is a condition that txt_option may be chosen if instance variable "can_be_chosen" is equal 0. Then after pressing button OK (line 10/11) "can be chosen" for particular instance variable "No" should turn to 1 (so it can't be chosen next time). I think it's very simple with my first thing above - it doesn't work.

    May please explain how to fix it?

    Many many thanks in advance!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Here's an updated file that should fix the issues you're having:

    dropbox.com/s/hpfy5kkyxa4vps9/Mapabox_MB.c3p

    In event 9 all txt_answerNew.number were being set to the same value.

    In 10/11 all instances of list_answer_input, txt_option and txt_answerNew were being acted on rather than those sharing the button number - you needed to pick the instances with the same number as the button.

    If you want to simplify your events, instead of picking instances using a shared number value I would consider adding these objects into a container together - that way, when you pick an instance the instances in its container are automatically picked.

  • You are great!

    Thank you very much for your time and help!!!

  • You're welcome :-)

  • Hi mekonbekon

    I've at least 100 random events in my game. They appear every 10 seconds. They are like:

    1)There is a pandemic. Will you open hospitals?

    -Yes -No

    Every yes and no answer has its own consequences. For example: If my player says Yes, his popularity will increase by 50, his money will increase by 1000 and his success will increase by 20. Money, popularity and success are my three global variables. Yet my events come randomly and sometimes the same event comes in row 3 or 4 times. I check the template you share but quite don't get it how to apply it to my game.

    Can you help me with that? I want my events to come in order and not to repeat itself. I don't know how to do it.:(

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)