示例#1
0
        // gets datatable from DB and fills collection
        public void FillQuestion()
        {
            DataTable dtQuestion = DBAccess.GetAnswers(this.ID.ToString());

            foreach (DataRow dr in dtQuestion.Rows)
            {
                cAnswer oAnswer = new cAnswer();
                oAnswer.Load(dr);
                this.Add(oAnswer);

                // check if correct answer
                if (oAnswer.IsCorrect)
                {
                    this.CorrectAnswerID = this.mcol.Count - 1;
                }
            }
        }
示例#2
0
 // add given cAnswer to collection
 private void Add(cAnswer newAnswer)
 {
     mcol.Add(newAnswer);
 }