Example #1
0
        /// <summary>
        /// Отобразить вопрос
        /// </summary>
        /// <param name="question">экземпляр вопроса</param>
        private void ShowQuestion(QuestionType type)
        {
            _panel.Controls.Clear();

            UserControl uc = new UserControl();

            if (type == QuestionType.SingleSelect)
            {
                uc = new UserControlSingle(_bsAnswers);
            }
            if (type == QuestionType.MultipleSelect)
            {
                uc = new UserControlMulti(_bsAnswers);
            }

            _panel.Controls.Add(uc);
        }
Example #2
0
        /// <summary>
        /// Отобразить вопрос
        /// </summary>
        /// <param name="question">экземпляр вопроса</param>
        private void ShowQuestion(QuestionType type)
        {
            _panel.Controls.Clear();

            UserControl uc = new UserControl();

            if (type == QuestionType.SingleSelect)
            {
                uc = new UserControlSingle(_bsAnswers);
            }
            else
            {
                uc = new UserControlMulti(_bsAnswers);
            }
            label5.Text = "Выберите правильный ответ";
            _panel.Controls.Add(uc);
        }
Example #3
0
        /// <summary>
        /// Загрузка ответов к текущему вопросу
        /// </summary>
        private void LoadAnswers()
        {
            var currentQuestion = _bsQuestions.Current as Question;
            var bs = new BindingSource();

            bs.DataSource = currentQuestion.Answers;

            UserControl uc = new UserControl();

            if (currentQuestion.Type == QuestionType.SingleSelect)
            {
                uc = new UserControlSingle(bs);
            }
            else
            {
                uc = new UserControlMulti(bs);
            }
            _panel.Controls.Clear();
            _panel.Controls.Add(uc);
        }