Пример #1
0
        public void showHelp(TestWebForm form)
        {
            string path = mapPath + @"\help_templates.html";
            string help = (new StreamReader(path)).ReadToEnd();

            help = help.Replace("%url%", "\"http://GMATClubChallenge.com/TestWebForm.aspx\"");
            StreamWriter sr = File.CreateText(mapPath + @"\help.html");

            sr.Write(help);
            sr.Close();
            form.Response.Redirect("help.html");
        }
Пример #2
0
 public void SectionExit(TestWebForm form)
 {
     if (navigator.HasNextSet)
     {
         GetNextSet();
         form.Response.Redirect("descriptionWebForm.aspx");
     }
     else
     {
         endTest(form);
     }
 }
Пример #3
0
        public void TestWebForm_Init(TestWebForm testWebForm)
        {
            answerRadioButtonList = testWebForm.AnswerRadioButtonList;
            statusLabel           = testWebForm.StatusLabel;

            //testWebForm.answerConfirmImagebutton.Visible = true;
            loginStatusHyperLink = testWebForm.LoginStatusHyperLink;
            statusLabel.Visible  = false;
            if (testWebForm.IsPostBack)
            {
                DeletePicturesFiles();
            }
        }
Пример #4
0
 public void TestWebForm_CreateScripts(TestWebForm form)
 {
     for (int i = 0; i < questionAnswerSet.Answers.Count; i++)
     {
         nextClickScript += "if (document.Form1.answerRadioButtonList_" + i +
                            ".checked) {document.Form1.answerConfirmImg.src ='images/answerConfirm.gif'; document.Form1.nextButton.src = 'images/_nextButton.gif'; document.Form1.isAnswerConfirm.value=\"nextClicking\"} ";
         //answerConfirmClickScript += "if (document.Form1.answerRadioButtonList_" + i.ToString() + ".checked) {document.Form1.isAnswerConfirm.value=\"answerConfirm\";document.Form1.submit(''); ";
     }
     answerConfirmClickScript +=
         "if (document.Form1.isAnswerConfirm.value == \"nextClicking\"){document.Form1.isAnswerConfirm.value=\"answerConfirm\";document.Form1.submit(''); }";
     //
     form.nextClickScript          = nextClickScript;
     form.answerConfirmClickScript = answerConfirmClickScript;
 }
Пример #5
0
        private void TestFormInit(TestWebForm testWebForm)
        {
            GetNextQuestion();

            loginStatusHyperLink.Text        = "Log out...";
            loginStatusHyperLink.NavigateUrl = "loginWebForm.aspx";
            questionGUID = Guid.NewGuid();
            testWebForm.PassageImage.Visible = false;
            if (question.SubtypeId == (int)BuisinessObjects.Subtype.ReadingComprehensionPassage)
            {
            }
            if (question.SubtypeId == (int)BuisinessObjects.Subtype.ReadingComprehensionQuestionToPassage)
            {
                passageGUID = Guid.NewGuid();
                imageSet    = renderer.Render(question);
                testWebForm.PassageImage.Visible = true;
                imageSet.Question.Save(
                    mapPath + @"\images\Question&AnswerTempPictures\" + questionGUID + ".gif",
                    ImageFormat.Gif);
                testWebForm.QuestionImage.ImageUrl = @"images/Question&AnswerTempPictures/" + questionGUID +
                                                     ".gif";
                (renderer.RenderPasssageToQuestion(navigator.GetPasssageToQuestion(question.Id))).Save(
                    mapPath + @"\images\Question&AnswerTempPictures\" + passageGUID + ".gif", ImageFormat.Gif);
                testWebForm.PassageImage.ImageUrl = @"images/Question&AnswerTempPictures/" + passageGUID +
                                                    ".gif";
                PrepareAndRenderAnswers();
            }
            else
            {
                imageSet = renderer.Render(question);
                imageSet.Question.Save(
                    mapPath + @"\images\Question&AnswerTempPictures\" + questionGUID + ".gif",
                    ImageFormat.Gif);
                testWebForm.QuestionImage.ImageUrl = @"images/Question&AnswerTempPictures/" + questionGUID +
                                                     ".gif";
                PrepareAndRenderAnswers();
            }


            testWebForm.clockHiddenParam += "<INPUT id=\"timehh\" type=\"hidden\" value=\"" +
                                            navigator.RemainedTime.Hours + "\" name=\"timehh\">";
            testWebForm.clockHiddenParam += "<INPUT id=\"timemm\" type=\"hidden\" value=\"" +
                                            navigator.RemainedTime.Minutes + "\" name=\"timemm\">";
            testWebForm.clockHiddenParam += "<INPUT id=\"timess\" type=\"hidden\" value=\"" +
                                            navigator.RemainedTime.Seconds + "\" name=\"timess\">";

            testWebForm.TestNameLabel.Text = "Test: " + testRow.Name;

            //<INPUT id="isAnswerConfirm" type="hidden" value="false" name="isAnswerConfirm"><INPUT id="Hidden1" type="hidden" name="endData">
        }
Пример #6
0
 public void TestWebForm_AnswerConfirm(TestWebForm testWebForm)
 {
     navigator.SetUserAnswer(questionAnswerSet.Answers[testWebForm.AnswerRadioButtonList.SelectedIndex].Id);
     if (!navigator.HasNextQuestion)
     {
         if (navigator.HasNextSet)
         {
             GetNextSet();
             testWebForm.Response.Redirect("descriptionWebForm.aspx");
         }
         else
         {
             endTest(testWebForm);
         }
     }
 }
Пример #7
0
        public void TestWebForm_Load(TestWebForm form)
        {
            switch (form.status)
            {
            case "NONE":
                break;

            case "answerConfirm":
                TestWebForm_AnswerConfirm(form);
                break;

            case "sectionExit":
                SectionExit(form);
                break;

            case "exit":
                TestWebForm_Exit(form);
                break;
            }

            TestFormInit(form);
        }
Пример #8
0
 public void TestWebForm_Exit(TestWebForm form)
 {
     form.Response.Redirect("mainwebform.aspx");
 }
Пример #9
0
 private void endTest(TestWebForm form)
 {
     end(form);
 }