Ejemplo n.º 1
0
    public void StartIntervalQuiz()
    {
        chooseQuizPanel.SetActive(false);
        IntervalQuizPanel.SetActive(true);
        scorePanel.SetActive(true);
        loadQuizMenuButton.SetActive(true);
        //creates the IntervalTest object which extends test
        activeTest = new IntervalTest();
        activeTest.GenerateAnswer();
        //picks a random # from 0-2 (inclusive)
        int rightAnswerButtonIndex = rand.Next(0, 3);

        //starting at the top and going down
        for (int i = 0; i < intervalQuizResponseButtons.Length; i++)
        {
            intervalQuizResponseButtons[i].SetActive(true);
            if (i == rightAnswerButtonIndex)
            {
                //set the text to the correct answer
                string rightAnswer = activeTest.GetAnswer();
                intervalQuizResponseButtons[i].GetComponentInChildren <Text>().text = rightAnswer;
            }
            else
            {
                //generate a false answer and set text
                string falseAnswer = activeTest.GetFalseAnswer();
                intervalQuizResponseButtons[i].GetComponentInChildren <Text>().text = falseAnswer;
            }
        }
        PlayAnswer();
    }
Ejemplo n.º 2
0
 public void ReturnToQuizMenu()
 {
     triadQuizPanel.SetActive(false);
     IntervalQuizPanel.SetActive(false);
     scorePanel.SetActive(false);
     score = 0;
     chooseQuizPanel.SetActive(true);
     loadQuizMenuButton.SetActive(false);
 }