public AddinNewTheme(string theme, string section, int count) { Finished = false; CurrentTest = new Test(); CurrentQuestion = new Question(); CurrentTest.Section = section; CurrentTest.Info = theme; Count = count; CurrentQuestionId = 1; InitializeComponent(); label1.Text = String.Format("Question #{0}", CurrentQuestionId); }
private void Button3Click(object sender, EventArgs e) { if (!VerifyForm()) return; CurrentQuestion.Info = TitleText.Text; CurrentTest.QuestionArray.Add(CurrentQuestion); if (CurrentQuestionId < Count) { CurrentQuestionId++; CurrentQuestion = new Question(); listBox1.Items.Clear(); listBox2.Items.Clear(); label1.Text = String.Format("Question #{0}", CurrentQuestionId); TitleText.Text = ""; } else { MessageBox.Show(@"All questions are configured. We prepared to save test."); Finished = true; Close(); } }
private void LoadQuestion(Question thisQuestion) { label1.Text = String.Format("{0}{1}", "Question #", CurrentNumQuestion+1); QuestionText.Text = thisQuestion.Info; VariantList.Items.Clear(); foreach (var i in thisQuestion.AnsArray) { VariantList.Items.Add(i); } }