Exemple #1
0
        public async void SetQuestions(Question[] questions, string groupId, string subgroupId)
        {
            try
            {
                foreach (Question question in questions)
                {
                    QuestionControl newQuestionControl = new QuestionControl();
                    newQuestionControl.SetQuestionText(question.Text);
                    newQuestionControl.Question = question;

                    _questions.Add(newQuestionControl);

                    QuestionsControl.AddNewQuestion(newQuestionControl);
                }

                _groupId    = groupId;
                _subGroupId = subgroupId;
                TestingGroupBox.IsEnabled  = true;
                TakeToTestButton.IsEnabled = false;
            }
            catch (Exception exception)
            {
                await this.ShowMessageAsync("Ошибка (SetQuestions)", exception.Message);
            }
        }
Exemple #2
0
 public async void ResultEndTesting(bool result, string message)
 {
     try
     {
         if (result)
         {
             QuestionsControl.ClearChildren();
             await this.ShowMessageAsync("Результат", message);
         }
         else
         {
             await this.ShowMessageAsync("Результат", message);
         }
     }
     catch (Exception exception)
     {
         await this.ShowMessageAsync("Ошибка (ResultEndTesting)", exception.Message);
     }
     finally
     {
         _isTesting = false;
     }
 }