예제 #1
0
        private static string getTQText(QTextChoice question)
        {
            string q_main = string.Format(
                  "Название вопроса: {0}" + Environment.NewLine +
                  "Тип: {1}" + Environment.NewLine +
                  "Максимальный балл: {2}" + Environment.NewLine +
                  "Текст вопроса: {3}" + Environment.NewLine,
                  question.Name,
                  "Одиночный  выбор",
                  question.MaxBall,
                  question.Data.Text
               );
            string q_answers = "";
            #region get_answers
            int n = 1;
            foreach (Answer ans in question.Answers)
            {
                string answer;
                answer = string.Format("{0}) [Правильный] {1}", n, ans.Data.Text);

                q_answers += answer + Environment.NewLine;
                n++;
            }

            #endregion

            q_main += Environment.NewLine + q_answers;
            return q_main;
        }
예제 #2
0
        private void AddQuestion_Executed(object sender)
        {
            QuestionTypeChooseDialog dlg = new QuestionTypeChooseDialog(new List<QuestionType>(){QuestionType.SingleChoice,QuestionType.MultiChoice,QuestionType.TextQuestion});
            if (dlg.ShowDialog() == true)
            {
                QuestionBase question = null;
                if (dlg.ChoosenType == QuestionType.SingleChoice)
                {
                    question = new QSingleChoice();
                }
                if (dlg.ChoosenType == QuestionType.MultiChoice)
                {
                    question = new QMultiChoice();
                }

                if (dlg.ChoosenType == QuestionType.TextQuestion)
                {
                    question = new QTextChoice();
                }

                if (question != null)
                {
                    question.Name = "Question " + (this.Questions.Count+1);
                    question.Number = this.Questions.Count;

                    this._manager.AddQuestion(question);
                    OnUpdateQuestionsListHandler(this,new EventArgs());
                    ShowQuestion(question);
                }
            }
        }
 public TextAnswerQuestionViewModel(QTextChoice questionModel)
     : base(questionModel)
 {
 }