Пример #1
0
 /// <summary>
 /// Populates the combo box with a list of possible answers to select from.
 /// </summary>
 /// <param name="q">The question to use for population.</param>
 private void InitComboBox(Question q)
 {
     _view.CorrectAnswer.Items.Clear();
     for (int i = 0; i < 4; i++)
     {
         _view.CorrectAnswer.Items.Add(q.Answers[i]);
     }
     _view.CorrectAnswer.SelectedIndex = q.CorrectAnswer;
 }
Пример #2
0
 /// <summary>
 /// Adds a single question to the question view.
 /// </summary>
 /// <param name="q">The question object to add.</param>
 private void AddQuestionToView(Question q)
 {
     _view.QuestionView.Items.Add((_view.QuestionView.Items.Count + 1).ToString(), 0);
     _view.QuestionView.Items[_view.QuestionView.Items.Count - 1].SubItems.Add(q.QuestionText);
     _view.QuestionView.Items[_view.QuestionView.Items.Count - 1].SubItems.Add(q.Answers[q.CorrectAnswer]);
 }