private void CHK_Option1_CheckedChanged(object sender, EventArgs e) { try { TMR_ChangeQuestion.Enabled = true; TMR_ChangeQuestion.Start(); } catch (Exception ex) { ExceptionHandler.HandleException(ex.Message, this.Name, "CHK_Option1_CheckedChanged"); } }
private void TMR_ChangeQuestion_Tick(object sender, EventArgs e) { try { if (QuestionIndex <= questionsList.Count) { sSave(); QuestionIndex += 1; sGetNextQuestion(QuestionIndex); TMR_ChangeQuestion.Enabled = false; TMR_ChangeQuestion.Stop(); } } catch (Exception ex) { ExceptionHandler.HandleException(ex.Message, this.Name, "TMR_ChangeQuestion_Tick"); } }
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"); } }