コード例 #1
0
        public ActionResult Show(int id, string answer)
        {
            var currentUser = User.Identity.GetUserId();

            var result = ExerciseService.CheckAnswer(id, currentUser, answer);

            if (result.Success)
            {
                if (!ExerciseService.CheckUserHasRecord(currentUser, id))
                {
                    ExerciseService.UpdateUserExercise(currentUser, id, false);
                    ExerciseService.SumPoints(currentUser);
                }

                NewTrophy = this.TrophyService.UpdateUserTrophies(currentUser);
            }

            return(PartialView("_Result", result));
        }