Esempio n. 1
0
 public void sNew()
 {
     try
     {
         Timer_ExamTime.Stop();
         isChecked = false;
         questionsList.Clear();
     }
     catch (Exception ex)
     {
         ExceptionHandler.HandleException(ex.Message, "FRM_Exam", "sNew");
     }
 }
Esempio n. 2
0
        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");
            }
        }