public void imageButton_Click(object sender, ImageClickEventArgs e) { if (!((navigator.HasNextSet) || (navigator.HasNextQuestion))) { navigator.CommitResult(); _reviewWebForm.Response.Redirect("ManagePersonal.aspx?panel=results"); } else { _reviewWebForm.Response.Redirect("practicewebform.aspx"); } }
public void SectionExit() { DialogResult result = MessageBox.Show( "You will not be able to return to this section. Do you really want to exit from the current section?", MainForm.APP_CAPTION, MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (result == DialogResult.Yes) { if (navigator.HasNextSet) { GetNextSet(); ShowDescriptionDialog(false); if (!navigator.HasNextQuestion) { MessageBox.Show("Set has no questions.", MainForm.APP_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error); } else { NextQuestion(); } } else { try { navigator.CommitResult(); ShowResultDetailsOnEndTest(); } catch (Exception e) { MessageBox.Show("Cannot commit the results of the test to the database: " + e.Message, MainForm.APP_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error); } throw new EndTestException(); } } }
private void CheckNavigator(INavigator navigator) { QuestionSetSet.QuestionSetsRow qs; QuestionAnswerSet qd = new QuestionAnswerSet(); while (navigator.HasNextSet) { if (navigator.HasPreviousSet && random.Next(3) == 1) { qs = navigator.GetPreviousSet(); } else { qs = navigator.GetNextSet(); } while (navigator.HasNextQuestion) { if (navigator.HasPreviousQuestion && random.Next(3) == 1) { navigator.GetPreviousQuestion(qd); } else { navigator.GetNextQuestion(qd); } QuestionAnswerSet.QuestionsRow q = qd.Questions[0]; if (q.SubtypeId == (byte)Question.Subtype.ReadingComprehensionPassage) { Assert.Fail("Set cannot directly contain question of type ReadingComprehensionPassage"); } if (q.SubtypeId == (byte)Question.Subtype.ReadingComprehensionQuestionToPassage) { navigator.GetPasssageToQuestion(q.Id); } QuestionAnswerSet.AnswersRow[] a = q.GetAnswersRows(); navigator.SetUserAnswer(a[random.Next(a.Length)].Id); } } navigator.CommitResult(); }