Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Sep 05, 2019 at 06:41 AM by MOJAJA for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by MOJAJA · Sep 03, 2019 at 10:16 AM · gamerandomdisplayquiz

How to check the result after playing in quiz game?[Solve]

Hi all , I want to let the player can check the result is true or false in the end.

Example: questions:1~10 (random) . In the end , the panel will display questions:1~10 (according to front).

But I use random questions, so I have a little stuck.

Should I fix something ? Can someone give me a point.

Now, I can let the question show on display,but it's not correct.

 private void ShowQuestion()
     {
         timeLeft = timeMax;
         RemoveAnswerButton();
         
         isRoundActive = true ;
         timeRemaining = currentRoundData.timeLimitInSeconds;
         questionIndex = Random.Range(0, questionPools.Count);
         
         QueData queData = questionPools[questionIndex];
        
         questionPools.Remove(queData);
 
       
         queDatatext.text = queData.queText;
 
         explanText.text = queData.explanation.chineseText;
 
         GameObject wordButtonObject = wordObjectPool.GetObject();
         wordButtonObject.transform.SetParent(wordParent);       **//End panel will display**
 
          WordButton wordButton = wordButtonObject.GetComponent<WordButton>();
     wordButton.Setup(GameCon.FindObjectOfType<GameCon>());        //Now the panel will display same
         
         
         for (int i = 0; i < queData.answers.Length ; i++) 
         {
                 RandomButton();
 
                 GameObject ansButtonObject = answerButtonObjectPool.GetObject();
                 answerButtonGameObjects.Add(ansButtonObject);
                 ansButtonObject.transform.SetParent(ansButtonParent);
                 
 
                 AnsButton answerButton = ansButtonObject.GetComponent<AnsButton>();
                 answerButton.Setup(queData.answers[i]);
 
                 StartCoroutine(DownloadTheAudio());
 
         }
 
         StartCoroutine(QAin());
 
     }

WordButton

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.UI;
 
 public class WordButton : MonoBehaviour
 {
 
     public Text queText;
     public Text explainText;
     public Color[] changeColor;
     private GameCon gamecon;
 
     void Start()
     {
         
     }
     
     public void Setup(GameCon data)
     {
        
         gamecon= data;
         queText.text = gamecon.queDatatext.text;     
        
   
     }
 }
 

Like this alt text

02.png (12.3 kB)
Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image xxmariofer · Sep 04, 2019 at 10:13 AM 0
Share

i am having some issues understanding parts of the code, are you already able to display the box with the answers that you have shared or thats what you want to achieve?

avatar image MOJAJA xxmariofer · Sep 04, 2019 at 10:21 AM 0
Share

it's can display to the box with answer , but it's not correct . ex: if this round questions [4-1-3-9-8-2-10-7-5-6] ,so the true display is [ [4-1-3-9-8-2-10-7-5-6], but the box display [1-5-6-6-10-4-2-1-9-3]. how do I fix it?

avatar image MOJAJA xxmariofer · Sep 05, 2019 at 02:57 AM 0
Share

Hi @xxmariofer , I already fixed. I fixed the part of Setup . it's can work now. Thank you for take the time to reply me!

avatar image xxmariofer MOJAJA · Sep 05, 2019 at 06:07 AM 0
Share

hey! its late here i was just going to take a look into it now :) close the question in case people dont see your comment

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

149 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Randomizing numbers on a list. 4 Answers

how to randomize questions but still show all the questions? 1 Answer

I am trying to Randomize my Answers? 1 Answer

Make quiz game Confused About PlayerPrefs and database 1 Answer

How to make objects appear randomly around a spot 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges