public async Task <IActionResult> GetQuizzes() { var quizzes = await _dbContext.Quizzes .Include(q => q.Questions) .ThenInclude(a => a.Answers) .ToListAsync(); try { return(Ok(_quizRepo.ListAllQuizzes())); } catch (Exception ex) { _logger.LogError($"Failed to find quiz: {ex}"); return(BadRequest("Failed to get quiz")); } }
// GET: Quiz public IActionResult Index() { var quiz = _quizRepo.ListAllQuizzes(); return(View(_quizRepo.ListAllQuizzes())); }