Beispiel #1
0
        public async Task <IActionResult> OnGetAsync(int?numberOfQuestionsLeft, int numberOfAnswers, int?questionId)
        {
            if (questionId == null)
            {
                return(NotFound());
            }

            Question = await _databaseLogic.GetQuestion(questionId);

            await _databaseLogic.GetAllSurveys();

            if (Question.Survey != null)
            {
                Survey = await _databaseLogic.GetSurvey(Question.Survey.Id);
            }


            NumberOfAnswersLeft   = numberOfAnswers;
            NumberOfQuestionsLeft = numberOfQuestionsLeft;

            if (Question == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Beispiel #2
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Question = await _databaseLogic.GetQuestion(id);

            if (Question == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Beispiel #3
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Question = await _databaseLogic.GetQuestion(id);

            await _databaseLogic.GetAllAnswers();

            await _databaseLogic.GetAllSurveys();

            Survey = Question.Survey;


            if (Question == null)
            {
                return(NotFound());
            }
            return(Page());
        }