private void FrmExam_Load(object sender, EventArgs e)
        {
            FrmCounter frmCounter = new FrmCounter("Your Exam Starts In...");

            frmCounter.ShowDialog(this);

            _dateTime = _examBLL.GetDateTime(); //  set exam taken date and time

            _timer = new System.Timers.Timer(50);
            _timer.SynchronizingObject = lblTimeLimit;
            _timer.SynchronizingObject = this;
            _timer.Elapsed            += new ElapsedEventHandler(OnTimedEvent);
            _timer.Enabled             = true;

            _examineeTakeInfo.ExamDateTimeTaken = _dateTime;// _examBLL.GetDateTime(); //  set exam taken date and time
            //timer1.Enabled = true;
            lblTimeLimit.Text = _timeSpan.ToString("g");
        }
        private void SetQuestion()
        {
            _examItemCount = _examList.Single(e => e.ExamId == _examId).ItemCount;
            int examCount = _examList.Count;

            if (_questionNumber < _examItemCount)
            {
                _counter++;
                SetExaminationInfo();
                SetQuestionLabelText();
                SetChoice();
            }
            else
            {
                _subjectScoreList.Add(new SubjectScore
                {
                    SubjectName = _examList.Single(e => e.ExamId == _examId).Subject.SubjectName,
                    Score       = _examScore,
                    ItemCount   = _examItemCount
                });

                _examineeExamList[_index].Score = _examScore;   //  set score in exam taken
                _questionNumber = 0;
                _index++;
                _examScore = 0; //  reset score
                _counter   = 1; //  reset counter

                if (_index < examCount)
                {
                    _examId        = _examineeExamList[_index].ExamId;
                    _examItemCount = _examList.Single(e => e.ExamId == _examId).ItemCount;

                    SetExaminationInfo();
                    SetQuestionLabelText();
                    SetChoice();
                }
                else
                {
                    _doLoop        = false;
                    _timer.Enabled = false;

                    this.Visible = false;

                    _passingRateBLL = new PassingRateBLL();
                    _examineeTakeInfo.PassingRate = _passingRateBLL.GetCurrentPassingRate();

                    var examScoreSummary = _subjectScoreList
                                           .GroupBy(g => new
                    {
                        g.SubjectName,
                    })
                                           .Select(s => new
                    {
                        s.Key.SubjectName,
                        ItemCount  = s.Sum(ic => ic.ItemCount),
                        TotalScore = s.Sum(ts => ts.Score),
                        Result     = s.Sum(ts => ts.Score) >= Math.Ceiling(Compute.GetPercentage((double)_examineeTakeInfo.PassingRate, s.Sum(ic => ic.ItemCount))) ? true : false
                                     //,View = s.Sum(ts => ts.Score) + " >= " + Math.Ceiling(Compute.GetPercentage((double)_examineeTakeInfo.PassingRate, s.Sum(ic => ic.ItemCount)))
                    });

                    //foreach (var item in examScoreSummary)
                    //{
                    //    Console.WriteLine("Items: " + item.ItemCount + "     Score:" + item.TotalScore + "   |View:" + item.View);
                    //}

                    bool passedExam = examScoreSummary.Where(e => e.Result == false).Count() == 0;   //  if list got no failed(false) exam score
                    _examineeTakeInfo.Result = passedExam;

                    _examineeTakeBLL = new ExamineeTakeBLL();
                    _examineeTakeBLL.UpdateExamineeTake(_examineeTakeInfo);

                    _examineeBLL = new ExamineeBLL();
                    _examineeBLL.IncreaseExamineeExamTaken(_examineeTakeInfo.ExamineeId);

                    FrmCounter frmCounter = new FrmCounter("Your Exam Ends In...");
                    frmCounter.ShowDialog(this);
                    this.Close();
                }
            }
        }