public void setQuestionid(int questionid) { this.questionid = questionid; questiondao qd = new questiondao(); Question q = qd.getQuestion(questionid); q_name.Text = q.q_name; c_a.Text = q.c_a; c_b.Text = q.c_b; c_c.Text = q.c_c; c_d.Text = q.c_d; if (q.answer == "A") { A.Select(); } if (q.answer == "B") { B.Select(); } if (q.answer == "C") { C.Select(); } if (q.answer == "D") { D.Select(); } if (q.hardlevel == 1) { level1.Select(); } if (q.hardlevel == 2) { level2.Select(); } if (q.hardlevel == 3) { level3.Select(); } if (q.hardlevel == 4) { level4.Select(); } if (q.hardlevel == 5) { level5.Select(); } score.Text = q.score.ToString(); }
private void History_Load(object sender, EventArgs e) { questiondao qd = new questiondao(); q = qd.getQuestionList(); historydao hd = new historydao(); h = hd.getHistoryList(username, tpid); for (int i = 0; i < h.Count; i++) { ChooseNumBox.Items.Add(i); } q = new List <Question>(); for (int i = 0; i < h.Count; i++) { Question qu = qd.getQuestion(h[i].questionid); q.Add(qu); } LoadQuestion(); }