예제 #1
0
        public async Task <IActionResult> EditQuestion(int topicId, int testId, int questionId, string questionType)
        {
            List <AnswerModel> answers = (await _answersManager.GetAnswersByQuestionIdAsync(questionId))
                                         .Select(answer => _mapper.Map <AnswerModel>(answer))
                                         .ToList();

            ViewData["TopicId"]      = topicId;
            ViewData["TestId"]       = testId;
            ViewData["QuestionId"]   = questionId;
            ViewData["QuestionType"] = questionType;
            ViewData["QuestionText"] = await _questionManager.GetQuestionTextByIdAsync(questionId);

            ViewData["AnswersCount"] = await _answersManager.GetAnswerCountByQuestionIdAsync(questionId);

            return(View(answers));
        }