private void rdoD_CheckedChanged(object sender, EventArgs e) { CT_BaiThi ct = (CT_BaiThi)CT_BaiThi.thithu[index]; ct.setDapDaChon("D"); CT_BaiThi.thithu[index] = ct; capNhatThongBaoDapAnDaChon(index); }
private void capNhatThongBaoDapAnDaChon(int cau) { CT_BaiThi ct = (CT_BaiThi)CT_BaiThi.thithu[cau]; String[] arr = new string[2]; arr[0] = ct.getThuTu().ToString(); arr[1] = ct.getDapAnDaChon().ToString(); ListViewItem baiThi = new ListViewItem(arr); this.summarylistview.Items[cau] = baiThi; }
private void checkDapAnDaChon() { CT_BaiThi ct = (CT_BaiThi)CT_BaiThi.thithu[index]; if (ct.getDapAnDaChon().Equals("")) { rdoA.Checked = false; rdoB.Checked = false; rdoC.Checked = false; rdoD.Checked = false; } else { switch (ct.getDapAnDaChon()) { case "A": { rdoA.Checked = true; rdoB.Checked = false; rdoC.Checked = false; rdoD.Checked = false; break; } case "B": { rdoA.Checked = false; rdoB.Checked = true; rdoC.Checked = false; rdoD.Checked = false; break; } case "C": { rdoA.Checked = false; rdoB.Checked = false; rdoC.Checked = true; rdoD.Checked = false; break; } case "D": { rdoA.Checked = false; rdoB.Checked = false; rdoC.Checked = false; rdoD.Checked = true; break; } } } }
private void frmTracNghiem_Load(object sender, EventArgs e) { soCauThi = boDe.Count; this.cT_BAITHITableAdapter.Connection.ConnectionString = Program.connstr; // TODO: This line of code loads data into the 'dS.CT_BAITHI' table. You can move, or remove it, as needed. //this.cT_BAITHITableAdapter.Fill(this.dS.CHITIETBAITHI); // TODO: This line of code loads data into the 'dSQLTN.CT_BAITHI' table. You can move, or remove it, as needed. toolStripStatusHOTEN.Text = "Họ và tên: " + Program.mHoTen; toolStripStatusMAGV.Text = "Mã SV:" + Program.mUserId; toolStripStatusNHOM.Text = "nhóm: SINHVIEN"; toolStripStatusMALOP.Text = "mã lớp: "; toolStripStatusTENLOP.Text = "tên lớp: "; BoDe b = (BoDe)boDe[index]; lblNOIDUNG.Text = "Câu " + index + 1 + ": " + b.NoiDung; rdoA.Text = b.DapAnA; rdoB.Text = b.DapAnB; rdoC.Text = b.DapAnC; rdoD.Text = b.DapAnD; soCauThi = g.SoCauThi; String lenh = "EXEC SP_TIMKIEMMH '" + g.MaMH + "'"; Program.myReader = Program.ExecSqlDataReader(lenh); Program.myReader.Read(); String tenMH = Program.myReader.GetString(1); Program.myReader.Close(); lblLOP.Text = "Lớp: " + ""; lblMONHOC.Text = "Môn học: " + tenMH; lblNGAYTHI.Text = "Ngày thi: " + g.NgayThi.ToString("dd/MM/yyyy"); lblTRINHDO.Text = "Trình độ: " + g.TrinhDo; btnCAUTRUOC.Enabled = false; mm = g.ThoiGian; t.Interval = 1000; t.Tick += new EventHandler(this.t_Tick); t.Start(); //Copy dữ liệu từ bộ đề sang chi tiết bài thi int i = 1; foreach (BoDe b2 in boDe) { int cauHoi = b2.CauHoi; String maMH = b2.MaMH; String trinhDo = b2.TrinhDo; String noiDung = b2.NoiDung; String A = b2.DapAnA; String B = b2.DapAnB; String C = b2.DapAnC; String D = b2.DapAnD; String dapAn = b2.DapAnDung; String maGV = b2.MaGV; String dapAnDaChon = ""; CT_BaiThi ct = new CT_BaiThi(cauHoi, i, noiDung, A, B, C, D, dapAn, dapAnDaChon); CT_BaiThi.thithu.Add(ct); i++; } /*cập nhật thông báo đáp án đã chọn*/ // capNhatThongBaoDapAnDaChon(); numericUpDownCAUINDEX.Maximum = 100; numericUpDownCAUINDEX.Minimum = 1; summarylistview.View = View.Details; summarylistview.GridLines = true; summarylistview.FullRowSelect = true; foreach (CT_BaiThi ct in CT_BaiThi.thithu) { String[] arr = new string[2]; arr[0] = ct.getThuTu().ToString(); arr[1] = ct.getDapAnDaChon().ToString(); ListViewItem baiThi = new ListViewItem(arr); this.summarylistview.Items.Add(baiThi); } }
private void ThiThu_Load(object sender, EventArgs e) { boDe = BoDe.boDe; soCauThi = boDe.Count; dS.EnforceConstraints = false; this.cTBAITHITableAdapter.Connection.ConnectionString = Program.connstr; BoDe b = (BoDe)boDe[index]; lblNOIDUNG.Text = "Câu " + index + 1 + ": " + b.NoiDung; rdoA.Text = b.DapAnA; rdoB.Text = b.DapAnB; rdoC.Text = b.DapAnC; rdoD.Text = b.DapAnD; Dangky g = Dangky.dangky; soCauThi = g.SoCauThi; lblMONHOC.Text = "Môn: " + Program.maMH; lblLOP.Text = "Lớp: " + Program.mMalop; lblNGAYTHI.Text = "Ngày thi: " + g.NgayThi.ToString("dd/MM/yyyy"); lblTRINHDO.Text = "Trình độ: " + g.TrinhDo; btnCAUTRUOC.Enabled = false; mm = g.ThoiGian; t.Interval = 1000;// bộ tính là 1s t.Tick += new EventHandler(this.t_Tick); t.Start(); //Copy dữ liệu từ bộ đề sang chi tiết bài thi int i = 1; foreach (BoDe b2 in BoDe.boDe) { String maCH = b2.MaCH; String noiDung = b2.NoiDung; String loaiCH = b2.LoaiCH; String dapAn = b2.DapAn; String maMH = b2.MaMH; String maTD = b2.MaTD; String maGV = b2.MaGV; DataTable lc = Program.ExecSqlDataTable("EXEC SP_GET_LUA_CHON '" + maCH + "'"); List <LuaChon> listLC = convertToListLC(lc); LuaChon.lc = listLC; LuaChon[] arrluachon = listLC.ToArray(); String A = arrluachon[0].TenLC; String B = arrluachon[1].TenLC; String C = arrluachon[2].TenLC; String D = arrluachon[3].TenLC; String dapAnDaChon = ""; CT_BaiThi ct = new CT_BaiThi(maCH, i, noiDung, A, B, C, D, dapAn, dapAnDaChon); CT_BaiThi.ct_baiThi.Add(ct); i++; } /*cập nhật thông báo đáp án đã chọn*/ // capNhatThongBaoDapAnDaChon(); numericUpDownCAUINDEX.Maximum = 100; numericUpDownCAUINDEX.Minimum = 1; summarylistview.View = View.Details; summarylistview.GridLines = true; summarylistview.FullRowSelect = true; foreach (CT_BaiThi ct in CT_BaiThi.ct_baiThi) { String[] arr = new string[2]; arr[0] = ct.getThuTu().ToString(); arr[1] = ct.getDapAnDaChon().ToString(); ListViewItem baiThi = new ListViewItem(arr); this.summarylistview.Items.Add(baiThi); } }