public CauHoi(string ma, ChuDe cd, string ndung, string dapan, string daydu) { maCauHoi = ma; chuDe = cd; noiDung = ndung; dapAn = dapan; dapAnDayDu = daydu; }
public override CauHoi GetQuestion(ChuDe cd) { List <CauHoi> l = data.GetQuestion(cd); Random rdm = new Random(); bool isSame; int ques; int count = 0; for (int i = 0; i < cauHoi.Count; i++) { for (int j = 0; j < l.Count; j++) { if (cauHoi[i].Topic.IDTopic == l[j].Topic.IDTopic && cauHoi[i].IDQuestion == l[j].IDQuestion) { count++; } } } do { isSame = false; ques = rdm.Next(l.Count); int i; for (i = 0; i < cauHoi.Count; i++) { if (cauHoi[i].IDQuestion == l[ques].IDQuestion) { isSame = true; } } if (i == cauHoi.Count && isSame == true && count == l.Count) { return(new CauHoi("", cd, "", "", "")); } } while (isSame); cauHoi.Add(l[ques]); return(l[ques]); }
public override CauHoi GetQuestion(ChuDe cd) { throw new NotImplementedException(); }
public abstract CauHoi GetQuestion(ChuDe cd);