//=======================================================
        //Service provided by Telerik (www.telerik.com)
        //Conversion powered by NRefactory.
        //Twitter: @telerik
        //Facebook: facebook.com/telerik
        //=======================================================

        private void FRM_Exam_Load(object sender, EventArgs e)
        {
            try

            {
                QuestionIndex = 0;
                sFillQuestionList();
                sGetNextQuestion(QuestionIndex);

                int     vQuestionCount = questionsList.Count;
                decimal remTime        = decimal.Parse((vQuestionCount * 0.5).ToString());
                int     var            = (int)remTime;
                int     minutes        = var;
                int     seconds        = (int)((remTime - minutes) * 60);
                LBL_QuestionTime.Text      = "30";
                LBL_ExamRemainingTime.Text = "00" + ":" + minutes + ":" + seconds;

                TMR_Question.Start();
                Timer_ExamTime.Enabled = true;
                Timer_ExamTime.Start();
                VoteTime = new TimeSpan(0, 0, minutes, seconds);
            }
            catch (Exception ex)
            {
                ExceptionHandler.HandleException(ex.Message, "FRM_Exam", "FRM_Exam_Load");
            }
        }
 public void sNew()
 {
     try
     {
         Timer_ExamTime.Stop();
         isChecked = false;
         questionsList.Clear();
     }
     catch (Exception ex)
     {
         ExceptionHandler.HandleException(ex.Message, "FRM_Exam", "sNew");
     }
 }
        private void sGetNextQuestion(int index)
        {
            try
            {
                if (questionsList.Count > 0)
                {
                    if (index < questionsList.Count)
                    {
                        LBL_QuestionTime.Text      = "30";
                        LBL_QuestionTime.ForeColor = Color.Black;
                        string vQno = "";
                        //if (index == 0)
                        //{
                        vQno = questionsList[index].vRow.ToString();
                        //}
                        //else
                        //{
                        //    vQno = (index).ToString();
                        //}

                        TXT_Description.Text   = questionsList[index].vDescription;
                        LBL_Description.Text   = "رقم السؤال" + " " + vQno;
                        TXT_Code.Text          = questionsList[index].vCode;
                        TXT_Code.Tag           = questionsList[index].vID;
                        LBL_CorrectAnswer.Text = questionsList[index].vCorrectAnswer.ToString();
                        CHK_Option1.Text       = questionsList[index].vOption1;
                        CHK_Option2.Text       = questionsList[index].vOption2;
                        if (questionsList[index].vOption3 != "")
                        {
                            CHK_Option3.Text    = questionsList[index].vOption3;
                            CHK_Option3.Visible = true;
                            LBL_Option3.Visible = true;
                        }
                        else
                        {
                            CHK_Option3.Visible = false;
                            LBL_Option3.Visible = false;
                        }
                        if (questionsList[index].vOption4 != "")
                        {
                            CHK_Option4.Text    = questionsList[index].vOption4;
                            CHK_Option4.Visible = true;
                            LBL_Option4.Visible = true;
                        }
                        else
                        {
                            CHK_Option4.Visible = false;
                            LBL_Option4.Visible = false;
                        }
                        sClearOptionSelect();
                    }
                    else
                    {
                        sSaveStudentTotalGrade();
                        TMR_ChangeQuestion.Enabled = false;
                        TMR_ChangeQuestion.Stop();
                        TMR_Question.Enabled = false;
                        TMR_Question.Stop();
                        Timer_ExamTime.Enabled = false;
                        Timer_ExamTime.Stop();
                        FRM_Finish vFrm = new FRM_Finish();
                        vFrm.message = "تهانينا ..... لقد انهيت الأمتحان بنجاح";
                        vFrm.ShowDialog();
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionHandler.HandleException(ex.Message, "FRM_Exam", "sGetNextQuestion");
            }
        }