private NhoNhanhCollection TaoDsONhoNhanh(List<TuVung> DSNgauNhien) { NhoNhanhCollection NhoNhanhColl = new NhoNhanhCollection(); for (int i = 0; i < 10; i++) { NhoNhanhBO nnBO = new NhoNhanhBO(); nnBO.STTEng = i; nnBO.NoiDungEng = DSNgauNhien[i].Tu; NhoNhanhColl.Add(nnBO); NhoNhanhBO nnBO1 = new NhoNhanhBO(); nnBO1.STTEng = i; nnBO1.NoiDungEng = DSNgauNhien[i].NghiaTu; NhoNhanhColl.Add(nnBO1); } return NhoNhanhColl; }
private NhoNhanhCollection HoanViONhoNhanh(NhoNhanhCollection nhonhanhColl) { NhoNhanhCollection nhonhanhCollCopy = nhonhanhColl; NhoNhanhCollection NhoNhanhColl = new NhoNhanhCollection(); int []kt= new int[20]; for (int k = 0; k < 20; k++) kt[k] = -1; int i = 0; int j = 20; while (i < 20) { int rd = random(j); NhoNhanhColl.Add(nhonhanhCollCopy.Index(rd)); nhonhanhCollCopy.Remove(rd); i++; j--; } return NhoNhanhColl; }
private void BatDau_NhoNhanhButton_Click(object sender, EventArgs e) { if (tuvunglambantest.ToList().Count < 10) { MessageBox.Show("Từ điển chỉ có "+tuvunglambantest.ToList().Count+" từ không đủ tạo ô chữ. Bạn hãy chọn thêm từ điển" ); return; } if (BatDau_NhoNhanhButton.Text == "Bắt đầu") { if (tuvunglambantest == null) { MessageBox.Show("Bạn hãy chọn từ điển để tạo các ô nhớ nhanh"); return; } //Load bài Các ô nhớ tuvungtaodebai = nhonhanhBUS.BaiTestNhoNhanh(tuvunglambantest); //Thao tác cho các Control hiển thị NhoNhanhGroupBox.Enabled = true; ChonTuDien_NhoNhanhButton.Enabled = false; BatDau_NhoNhanhButton.Text = "Kết thúc"; // //Load Ô nhớ nhanh foreach (Control ct in DeBai_NhoNhanhLayout.Controls) { ct.BackgroundImage = (System.Drawing.Bitmap)(English_Studying.Properties.Resources.Dice_Question); ct.Enabled = true; } } else { ReloadNhoNhanh(); } }
private void LuyenNhoNhanhButoon_Click(object sender, EventArgs e) { this.tabControl1.SelectedIndex = 3; TuVungButton.BackColor = System.Drawing.Color.Transparent; TuDienButton.BackColor = System.Drawing.Color.Transparent; TracNghiemHinhAnhButton.BackColor = System.Drawing.Color.Transparent; LuyenNhoNhanhButoon.BackColor = System.Drawing.Color.LightSkyBlue; TracNghiemButton.BackColor = System.Drawing.Color.Transparent; GiaiOChuButton.BackColor = System.Drawing.Color.Transparent; //reload nhớ nhanh foreach(Control ct in DeBai_NhoNhanhLayout.Controls) { ct.BackgroundImage = (System.Drawing.Bitmap)(English_Studying.Properties.Resources.Dice_Question); } BatDau_NhoNhanhButton.Text = "Bắt đầu"; ChonTuDien_NhoNhanhButton.Enabled = true; tuvungtaodebai = null; NhoNhanhGroupBox.Enabled = false; }