Exemplo n.º 1
0
        public async Task <IActionResult> GradeAssignment(int assignmentId)
        {
            var user = await GetCurrentUserAsync();

            if (user is TeacherAccount teacher)
            {
                var assignment = _assignments.GetById(assignmentId);
                var students   = _students.GetStudentsForSchoolClass(assignment.SchoolClass.Id);

                var model = new GradeAssignmentModel()
                {
                    Assignment = assignment,
                    Students   = students
                };

                return(View(model));
            }

            return(RedirectToAction("Error", "Home"));
        }