Пример #1
0
        public async Task <IActionResult> OnGetAsync(int index, int id, string submitter)
        {
            Index = index;

            Submissions = await _context.Submissions.AsNoTracking().Where(s => s.SubmitterId.Equals(submitter))
                          .Include(s => s.Assignment)
                          .ThenInclude(s => s.FeedbackLevelOption)
                          .Include(s => s.Assignment)
                          .ThenInclude(s => s.AssignmentApplicationModes)
                          .ThenInclude(s => s.ApplicationMode)
                          .Include(s => s.Assignment)
                          .ThenInclude(s => s.AssignmentCoverageTypeOptions)
                          .ThenInclude(s => s.CoverageTypeOption)
                          .Include(s => s.Feedback)
                          .ThenInclude(s => s.InstructorTestResults)
                          .ThenInclude(s => s.StudentTestResults)
                          .ThenInclude(s => s.TestCaseStatus)
                          .Include(s => s.Feedback)
                          .ThenInclude(s => s.InstructorTestResults)
                          .ThenInclude(s => s.TestResultConcepts)
                          .Include(s => s.Feedback)
                          .ThenInclude(s => s.InstructorTestResults)
                          .ThenInclude(s => s.TestCaseStatus)
                          .Include(s => s.Feedback)
                          .ThenInclude(s => s.EngineException)
                          .Include(s => s.Feedback)
                          .ThenInclude(s => s.ClassCoverages)
                          .ThenInclude(s => s.MethodCoverages)
                          .Where(s => s.AssignmentId.Equals(id))
                          .ToListAsync();

            if (!Submissions.Any())
            {
                return(NotFound());
            }

            if (index < 0 || index >= Submissions.Count)
            {
                return(NotFound());
            }

            Assignment = Submissions[0].Assignment;

            Submission = Submissions[index];

            HighCoverage   = (int)Assignment.TestCoverageLevel;
            MediumCoverage = (int)(Assignment.TestCoverageLevel * 0.75);

            return(Page());
        }