Exemplo n.º 1
0
        public async Task <IActionResult> BuildResult(int buildId)
        {
            if (!Project.ExplicitSubmissionRequired)
            {
                return(NotFound());
            }

            var buildResult = await BuildService.GetBuildResultAsync
                              (
                ClassroomName,
                ProjectName,
                buildId
                              );

            if (buildResult == null)
            {
                return(NotFound());
            }

            if (buildResult.Build.Commit.UserId != User.Id &&
                ClassroomRole < ClassroomRole.Admin)
            {
                return(Forbid());
            }

            var unreadFeedback = await SubmissionService.GetUnreadFeedbackAsync
                                 (
                ClassroomName,
                buildResult.Build.Commit.UserId
                                 );

            var viewModel = GetBuildViewModelAsync(buildResult, unreadFeedback);

            return(View(viewModel));
        }