public ActionResult Accept(int actionSubmitId, int presetId)
        {
            var submit = _actionSubmitService.Get(actionSubmitId, VersionOptions.Published);

            if (submit == null)
            {
                return(HttpNotFound());
            }
            var preset = submit.Objective != null?submit.Objective.ObjectiveResultPresets.FirstOrDefault(p => p.Id == presetId) : null;

            if (preset == null)
            {
                return(HttpNotFound());
            }

            _actionSubmitService.Approve(submit, preset);

            var shape = Services.New.Parts_ActionSubmit_StatusAdmin(ActionSubmit: submit);

            return(PartialView((object)shape));
        }
        public void SubmitAnswer(ObjectivePart objective, TeamPart team, string answer)
        {
            Argument.ThrowIfNull(objective, "objective");
            Argument.ThrowIfNull(team, "team");
            Argument.ThrowIfNullOrEmpty(answer, "answer");

            var newSubmit = _actionSubmitService.NewActionSubmit <QuestionSubmitPart>(objective, team, "QuestionSubmit");

            newSubmit.Answer = answer.Trim();

            _contentManager.Create(newSubmit);

            var question = objective.As <QuestionObjectivePart>();

            if (question != null && question.AutoValidate)
            {
                var newActionSubmit = newSubmit.As <ActionSubmitPart>();

                var answers = question.Answers.ToList();
                if (answers.Any(a => a.Answer.Trim().ToLowerInvariant() == answer.Trim().ToLowerInvariant()))
                {
                    var resultPreset = objective.ObjectiveResultPresets.FirstOrDefault();

                    var points            = resultPreset.Points;
                    var resultDisplayName = resultPreset.DisplayName;

                    if (question.HintUsedByTeams.Any(teamHint => teamHint.TeamPartRecord.ContentItemRecord.Id == team.ContentItem.Id))
                    {
                        points -= question.HintPrice;
                    }

                    _actionSubmitService.Approve(newActionSubmit, resultDisplayName, points);
                }
                else
                {
                    _actionSubmitService.Reject(newActionSubmit);
                }
            }
        }