예제 #1
0
    protected void PrepareQuestion(QuestionData.question q)
    {
        HideAllChoices();

        activeQuestion = q;

        question.text       = q.content;
        additionalInfo.text = "";

        //foreach (QuestionData.answer answer in q.answers)
        for (int i = 0; i < q.answers.Count; i++)
        {
            QuestionData.answer answer = q.answers[i];
            if (i < choices.Length)
            {
                UIButton choice = choices[i];
                ChangeButtonColor(choice, Color.white);

                UILabel label = choice.transform.FindChild("Label").GetComponent <UILabel>();

                if (label != null)
                {
                    label.text = answer.text;
                }
                choice.gameObject.SetActive(true);
            }
        }

        _enableTimer = true;
    }
예제 #2
0
    private void StartElement(ref QuestionData qData, XmlReader xml)
    {
        switch (xml.Name)
        {
            case "question":
                q = new QuestionData.question();
                break;

            case "answers":
                break;

            case "answer":
                answer = new QuestionData.answer();
                answer.option = xml.GetAttribute(0);
                break;
        }
    }