Пример #1
0
    /// <summary>
    /// Find a question with duplicated options, and direct users there
    /// </summary>
    /// <returns>Return 1 if an empty field is found, else return 0</returns>
    private int FindDuplicateOptions()
    {
        int questionWithDuplicateOptions = editLevelBL.CheckDuplicationOptions();

        if (questionWithDuplicateOptions != -1)
        {
            errorMessageLabel.SetText("Question " + questionWithDuplicateOptions + " has duplicate options!");

            switch (questionWithDuplicateOptions)
            {
            case 1:
                questionNumberLabel.SetText("Enter Question 1:");
                DisplayQuestion();
                break;

            case 2:
                questionNumberLabel.SetText("Enter Question 2:");
                DisplayQuestion();
                break;

            case 3:
                questionNumberLabel.SetText("Enter Question 3:");
                DisplayQuestion();
                break;

            case 4:
                questionNumberLabel.SetText("Enter Question 4:");
                DisplayQuestion();
                break;

            case 5:
                questionNumberLabel.SetText("Enter Question 5:");
                DisplayQuestion();
                break;
            }

            return(1);
        }
        else
        {
            GD.Print("No duplicate options found.");
            return(0);
        }
    }