public async Task <IActionResult> SectionReport(string sectionName, string assignment)
        {
            var assignments = await AssignmentService.GetAssignmentsAsync(ClassroomName);

            var assignmentGroups = assignments.GroupBy(a => a.GroupName)
                                   .OrderBy
                                   (
                g => g.Max
                (
                    a => a.DueDates.Count > 0 ? a.DueDates.Max(d => d.DueDate) : DateTime.MinValue
                )
                                   )
                                   .Select(g => g.Key)
                                   .ToList();

            ViewBag.SectionNames = new List <SelectListItem>
                                   (
                Classroom.Sections.OrderBy(s => s.Name).Select
                (
                    section => new SelectListItem()
            {
                Text     = section.DisplayName,
                Value    = section.Name,
                Selected = (sectionName == section.Name)
            }
                )
                                   );

            ViewBag.AssignmentGroups = new List <SelectListItem>
                                       (
                assignmentGroups.Select
                (
                    groupName => new SelectListItem()
            {
                Text     = groupName,
                Value    = groupName,
                Selected = (assignment == groupName)
            }
                )
                                       )
                                       .OrderBy(s => s.Text, new NaturalComparer())
                                       .Union
                                       (
                new[]
            {
                new SelectListItem()
                {
                    Text     = "All Recently Updated",
                    Value    = AllRecentlyUpdated,
                    Selected = (assignment == null)
                }
            }
                                       );

            ViewBag.GradebookNames = new List <SelectListItem>
                                     (
                Classroom.ClassroomGradebooks.Select
                (
                    classroomGradebook => new SelectListItem()
            {
                Text  = classroomGradebook.Name,
                Value = classroomGradebook.Name
            }
                )
                                     );

            return(View("SelectSectionReport"));
        }
        public async Task <IActionResult> Admin()
        {
            var assignments = await AssignmentService.GetAssignmentsAsync(ClassroomName);

            return(View(assignments));
        }
        public async Task <IActionResult> GetAssignemntsAsync(long courseId)
        {
            var result = await _assignmentService.GetAssignmentsAsync(courseId);

            return(Json(result));
        }