Exemple #1
0
        private void metroButtonFinish_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Bạn có chắc chắn muốn hoàn thành bài thi?\r\n" +
                                "Lưu ý: không thể hoàn tác sau khi xác nhận?",
                                "Xác nhận", MessageBoxButtons.YesNo) == DialogResult.No)
            {
                return;
            }
            timer1.Stop();
            metroLabel2.Visible       = false;
            metroLabel3.Visible       = false;
            status.Visible            = false;
            groupBoxInterface.Visible = false;
            groupBoxInfo.Visible      = false;
            metroButtonExit.Visible   = true;
            metroLabelStat.Top        = 120;
            metroLabelStat.Visible    = true;

            if (offi == true)
            {
                DataUlti.KetThucBaiThi(MHS, MaKyThi);
                ShowResult();
            }
            else
            {
                ShowPracticeResult();
            }
        }
Exemple #2
0
        private void Timer1_Tick(object sender, EventArgs e)
        {
            SaveProgress();
            c = c - 0.5;
            Int64    temp = (long)c * 10000000;
            TimeSpan ts   = new TimeSpan(temp);

            metroLabelTimer.Text = string.Format("{0:D2}h:{1:D2}m:{2:D2}s",
                                                 ts.Hours, ts.Minutes, ts.Seconds);
            // Khi hết giờ thì tự động ngắt tất cả.
            if (c == 0)
            {
                MessageBox.Show("Đã hết giờ làm bài!");
                DataUlti.KetThucBaiThi(MHS, MaKyThi);
                ShowResult();
            }
        }