Example #1
0
        public async Task <IActionResult> SectionBuildResults(string sectionName)
        {
            if (!Project.ExplicitSubmissionRequired)
            {
                return(NotFound());
            }

            var section = Classroom.Sections.SingleOrDefault(s => s.Name == sectionName);

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

            var builds = await BuildService.GetSectionBuildsAsync
                         (
                ClassroomName,
                ProjectName,
                sectionName
                         );

            var testCounts = GetTestCounts(builds);
            var tableInfo  = GetSectionBuildsTableInfo(testCounts, builds);
            var tableData  = GetSectionBuildsTableData(builds, testCounts.Keys);

            var viewModel = new SectionBuildResultsViewModel
                            (
                section.DisplayName,
                tableInfo,
                tableData
                            );

            return(View(viewModel));
        }