예제 #1
0
        public ActionResult QuizStats(string id)
        {
            var stats = QuizPlayService.GetQuizStatistics(id);


            return(View(stats));
        }
예제 #2
0
        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 }));
        }
예제 #3
0
        //id = quiz submission id
        public ActionResult QuizResult(string id)
        {
            var model = QuizPlayService.GetQuizResults(id);

            return(View(model));
        }