Beispiel #1
0
        public IActionResult Question(int id /*QuizUnitId*/)
        {
            QuizQuestionVM qqvm = context.GetNextQuestion(id, userManager.GetUserId(User));

            if (qqvm != null)
            {
                qqvm.SidebarArray = context.GetSidebarVMList(userManager.GetUserId(User));
                return(View(qqvm));
            }
            else
            {
                // finns inga mer frågor i det här quiz-unitet
                int categoryId = context.GetCategoryIdByQuizUnitId(id);
                return(RedirectToAction(nameof(Text), new { id = categoryId }));
            }
        }