Beispiel #1
0
        public IActionResult OnGet(int?questionID)
        {
            QuestionTypes = htmlHelper.GetEnumSelectList <QuestionTypeID>();

            if (questionID.HasValue)
            {
                Question = questionData.GetByQuestionID(questionID.Value);
            }
            else
            {
                Question = new Question();
                Question.Answers.Add(new Answer());
                Question.Answers.Add(new Answer());
                Question.Answers.Add(new Answer());
                Question.Answers.Add(new Answer());

                newQuestion = true;
            }

            if (Question == null)
            {
                return(RedirectToPage("./List"));
            }
            return(Page());
        }
Beispiel #2
0
        public IActionResult OnGet(int questionID)
        {
            Question = questionData.GetByQuestionID(questionID);
            Question.QuestionBody = Question.QuestionBody.Replace("\n", "<br>");

            if (Question == null)
            {
                return(RedirectToPage("./NotFound"));
            }
            return(Page());
        }
Beispiel #3
0
        public void OnGet(int TestID)
        {
            QuestionsInTest = new List <Question>();

            Test          = apTestData.GetTestByID(TestID);
            QuestionTests = apTestData.GetTestQuestions(TestID);


            for (int i = 0; i < QuestionTests.Count(); i++)
            {
                QuestionsInTest.Add(questionData.GetByQuestionID(QuestionTests[i].QuestionID));
            }

            foreach (var q in QuestionsInTest)
            {
                q.QuestionBody = q.QuestionBody.Replace("\n", "<br>");
            }

            ApplicantsOnTest      = apTestData.GetApplicantsAssignedToTestByID(TestID);
            ApplicantsOnTestCount = ApplicantsOnTest.Count();
        }