Esempio n. 1
0
 //public void FillAnswer(Answer.Symbol answerSym)
 //{
 //    FillAnswerCommand.Sym = answerSym;
 //    FillAnswerCommand.Do();
 //}
 public static Question MakeNew(int index, Typee questionType, string title, string subtitle, Questionnaire qn)
 {
     Question q = new Question();
     q.Index = index;
     q.Title = title;
     q.Subtitle = subtitle;
     q.QuestionType = questionType;
     q.AvailableAnswers = new AnswerList();
     q.SelectedAnswer = Answer.Empty;
     q.Questionnaire = qn;
     return q;
 }
Esempio n. 2
0
 public Question MakeCopy(Questionnaire qn)
 {
     Question q = new Question();
     q.Index = this.Index;
     q.Title = this.Title;
     q.Subtitle = this.Subtitle;
     q.QuestionType = this.QuestionType;
     q.AvailableAnswers = this.AvailableAnswers.MakeCopy();
     q.SelectedAnswer = Answer.Empty;
     q.Questionnaire = qn;
     return q;
 }
Esempio n. 3
0
 public FillAnswerCommand(Question parent)
 {
     this.Question = parent;
 }
Esempio n. 4
0
 //private void PopulateQuestionnaireUI(Questionnaire qn)
 //{
 //    labelQuestionnaireName.Text = qn.Subject;
 //}
 private void PopulateQuestionUI(Question q)
 {
     labelQuestionnaireIndex.Text = string.Format("第 {0} 份", q.Questionnaire.Index);
     labelQuestionnaireName.Text = q.Questionnaire.Subject;
     //lblSelectedAnswer.Text = q.SelectedAnswer.FullText;
     this.richTxtQuestion.Text = q.Title + Environment.NewLine + q.Subtitle;
     this.comboBox1.Items.Clear();
     this.comboBox1.Enabled = true;
     this.comboBox1.DisplayMember = "FullText";
     this.comboBox1.ValueMember = "Sym";
     //this.comboBox1.DataSource = qn.Questions[0].AvailableAnswers;
     object[] list = new object[q.AvailableAnswers.Count];
     for (int i = 0; i < q.AvailableAnswers.Count; i++)
     {
         list[i] = q.AvailableAnswers[i];
     }
     //this.comboBox1.Items.Insert(0, Answer.Empty);
     this.comboBox1.Items.AddRange(list);
 }