Пример #1
0
    public void UpdateResultItemData()
    {
        LogUtil.Log("UIPanelModeTypeChoice:UpdateResultItemData");

        UIUtil.SetLabelValue(labelResultItemStatus, GetStatusItemProgress());

        UIColors.UpdateColors();

        AppContentChoice choice = GetCurrentChoice();

        string typeValue = "CORRECT";
        string codeValue = "FALSE";

        if (isCorrect) //currentChoiceData.CheckChoices(true)) {
        {
            UIColors.UpdateColor(containerChoiceResultItem, UIColors.colorGreen);
            typeValue = "CORRECT!";
            GameAudioController.PlaySoundPlayerActionGood();
            choicesCorrect += 1;
        }
        else
        {
            UIColors.UpdateColor(containerChoiceResultItem, UIColors.colorRed);
            typeValue = "INCORRECT...";
            GameAudioController.PlaySoundPlayerActionBad();
        }

        foreach (AppContentChoiceItem choiceItem in choice.choices)
        {
            if (choiceItem != null)
            {
                if (choiceItem.IsTypeCorrect())
                {
                    codeValue = choiceItem.display;
                }
            }
        }

        if (choice != null)
        {
            string choiceResultType        = typeValue;
            string choiceResultValue       = codeValue;
            string choiceResultDescription = choice.description;
            string choiceResultDisplayName = choice.display_name;

            if (choice != null)
            {
                //choiceQuestion = choice.display_name + choice.code;
            }

            UIUtil.SetLabelValue(labelResultItemChoiceDisplayName, choiceResultDisplayName);
            UIUtil.SetLabelValue(labelResultItemChoiceDescription, choiceResultDescription);
            UIUtil.SetLabelValue(labelResultItemChoiceResultValue, choiceResultValue);
            UIUtil.SetLabelValue(labelResultItemChoiceResultType, choiceResultType);
        }
    }