public ActionResult QuizStats(string id) { var stats = QuizPlayService.GetQuizStatistics(id); return(View(stats)); }
public async Task <ActionResult> Play(Play model) //todo change { model.Id = Guid.NewGuid().ToString(); model.Answers.ForEach(x => x.SubmissionId = model.Id); if (User.Identity.IsAuthenticated) { model.QuizzardUserId = User.Identity.GetUserId(); await QuizPlayService.PlayQuiz(model.QuizzardUserId, model); } else { await QuizPlayService.PlayQuizAnonymously(model); } return(RedirectToAction("QuizResult", new{ id = model.Id })); }
//id = quiz submission id public ActionResult QuizResult(string id) { var model = QuizPlayService.GetQuizResults(id); return(View(model)); }