Exemplo n.º 1
0
        private void AddQuestion_Click(object sender, RoutedEventArgs e)
        {
            var newQuestion = new QuestionAddition(Topics);

            if (newQuestion.ShowDialog() == true)
            {
                var topic  = newQuestion.GetTopic();
                var code   = newQuestion.GetCode();
                var text   = newQuestion.GetText();
                var limits = newQuestion.GetLimits();

                if (QuastionCreation.TryCreateParameterQuestion(code, text, limits, out var question, out var errors))
                {
                    Topics[topic].AddParameterQuestion(question);
                    MessageBox.Show("Вопрос добавлен");
                }
                else
                {
                    MessageBox.Show("Вопрос не добавлен");
                }
            }
Exemplo n.º 2
0
 private bool SuccessfulExecution(out CompilerErrorCollection errors)
 {
     return(QuastionCreation.TryCreateParameterQuestion(GetCode(), GetText(), GetLimits(), out var question,
                                                        out errors));
 }