Exemple #1
0
    public void DiselectButton(ButtonManager bm)
    {
        if (checkedQuestion)
        {
            return;
        }
        int temp = -1;

        bm.ChangeState(ButtonManager.ButtonState.Normal);

        for (int i = 0; i < selectedAnswers.Count; ++i)
        {
            if (temp != -1)
            {
                buttons[selectedAnswers[i]].SetOrder(i - 1);
            }
            else if (buttons[selectedAnswers[i]] == bm)
            {
                temp = i;
            }
        }
        if (temp != -1)
        {
            selectedAnswers.RemoveAt(temp);
        }
    }
Exemple #2
0
    public void SelectButton(ButtonManager bm)
    {
        if (checkedQuestion)
        {
            return;
        }
        switch (questionType)
        {
        case Question.QuestionTypes.Test:
            DiselectAllButtons();
            if (selectedAnswers.Count == 1)
            {
                selectedAnswers[0] = bm.ID;
            }
            else
            {
                selectedAnswers.Add(bm.ID);
            }
            break;

        case Question.QuestionTypes.MultipleChoice:
            selectedAnswers.Add(bm.ID);
            break;

        case QuestionTypes.Order:
            bm.SetOrder(selectedAnswers.Count);
            selectedAnswers.Add(bm.ID);
            break;
        }
        bm.ChangeState(ButtonManager.ButtonState.Selected);
        string temp = "Respuestas seleccionadas: ";

        for (int i = 0; i < selectedAnswers.Count; ++i)
        {
            temp += selectedAnswers[i] + " | ";
        }
        Debug.Log(temp);
    }