Ejemplo n.º 1
0
    public void AddQuestionBtn()
    {
        TestCreateQuestionEntry question = Instantiate(m_instance, m_questionArea.transform);

        question.SetPanel(this);
        m_questions.Add(question);
    }
Ejemplo n.º 2
0
    private void AddQuestion(Test test)
    {
        TestCreateQuestionEntry question = Instantiate(m_instance, m_questionArea.transform);

        question.SetPanel(this);
        question.m_timeField.text         = test.m_answerTime.ToString();
        question.m_testType.value         = (int)test.m_type;
        question.m_questionNameField.text = test.m_question;
        for (int i = 0; i < test.m_variants.Length; ++i)
        {
            bool isRight = false;
            for (int j = 0; j < test.m_answers.Length; ++j)
            {
                if (test.m_variants[i].ID == test.m_answers[j])
                {
                    isRight = true;
                    break;
                }
            }
            question.AddAnswer(test.m_variants[i].text, isRight);
        }

        m_questions.Add(question);
    }