public async Task <IActionResult> ExamScore()
        {
            var CurrentUser = (Teacher)await _userManager.GetUserAsync(User);

            var Class = _context.Classes.SingleOrDefault(c => c.Id == CurrentUser.ClassId);

            Class.Students = _context.Students.Where(s => s.ClassId == Class.Id).ToList();
            var model = new AllDepartmentsExams();

            model.ScienceExams    = new List <StudentExams>();
            model.CommercialExams = new List <StudentExams>();
            model.ArtExams        = new List <StudentExams>();
            int ScienceId          = _context.Departments.Single(d => d.Name == "Science").Id;
            int CommercialId       = _context.Departments.Single(d => d.Name == "Commercial").Id;
            int ArtId              = _context.Departments.Single(d => d.Name == "Art").Id;
            int CurrentTermId      = _context.CurrentTerm.Id;
            var ScienceStudents    = _context.Students.Where(s => s.DepartmentId == ScienceId && s.ClassId == Class.Id);
            var CommercialStudents = _context.Students.Where(s => s.DepartmentId == CommercialId && s.ClassId == Class.Id);
            var ArtStudents        = _context.Students.Where(s => s.DepartmentId == ArtId && s.ClassId == Class.Id);

            foreach (var student in ScienceStudents)
            {
                var StudentExams = new StudentExams();
                StudentExams.StudentName = student.FullName;
                var Exams = _context.Exams.Where(e => e.StudentId == student.Id && e.TermId == CurrentTermId);
                StudentExams.Exams = Exams.Include(e => e.DepartmentSubject).ThenInclude(ds => ds.Subject).ToList();
                model.ScienceExams.Add(StudentExams);
            }
            foreach (var student in CommercialStudents)
            {
                var StudentExams = new StudentExams();
                StudentExams.StudentName = student.FullName;
                var Exams = _context.Exams.Where(e => e.StudentId == student.Id && e.TermId == CurrentTermId);
                StudentExams.Exams = Exams.Include(e => e.DepartmentSubject).ThenInclude(ds => ds.Subject).ToList();
                model.CommercialExams.Add(StudentExams);
            }
            foreach (var student in ArtStudents)
            {
                var StudentExams = new StudentExams();
                StudentExams.StudentName = student.FullName;
                var Exams = _context.Exams.Where(e => e.StudentId == student.Id && e.TermId == CurrentTermId);
                StudentExams.Exams = Exams.Include(e => e.DepartmentSubject).ThenInclude(ds => ds.Subject).ToList();
                model.ArtExams.Add(StudentExams);
            }
            return(View(model));
        }
        public IActionResult ClassExams(int Id)
        {
            var Class = _db.Classes.Find(Id);

            Class.Students = _db.Students.Where(s => s.ClassId == Class.Id).ToList();
            var model = new AllDepartmentsExams();

            model.ScienceExams    = new List <StudentExams>();
            model.CommercialExams = new List <StudentExams>();
            model.ArtExams        = new List <StudentExams>();
            int ScienceId          = _db.Departments.Single(d => d.Name == "Science").Id;
            int CommercialId       = _db.Departments.Single(d => d.Name == "Commercial").Id;
            int ArtId              = _db.Departments.Single(d => d.Name == "Art").Id;
            int CurrentTermId      = _db.CurrentTerm.Id;
            var ScienceStudents    = _db.Students.Where(s => s.DepartmentId == ScienceId && s.ClassId == Class.Id);
            var CommercialStudents = _db.Students.Where(s => s.DepartmentId == CommercialId && s.ClassId == Class.Id);
            var ArtStudents        = _db.Students.Where(s => s.DepartmentId == ArtId && s.ClassId == Class.Id);

            foreach (var student in ScienceStudents)
            {
                var StudentExams = new StudentExams();
                StudentExams.StudentName = student.FullName;
                var Exams = _db.Exams.Where(e => e.StudentId == student.Id && e.TermId == CurrentTermId);
                StudentExams.Exams = Exams.Include(e => e.DepartmentSubject).ThenInclude(ds => ds.Subject).ToList();
                model.ScienceExams.Add(StudentExams);
            }
            foreach (var student in CommercialStudents)
            {
                var StudentExams = new StudentExams();
                StudentExams.StudentName = student.FullName;
                var Exams = _db.Exams.Where(e => e.StudentId == student.Id && e.TermId == CurrentTermId);
                StudentExams.Exams = Exams.Include(e => e.DepartmentSubject).ThenInclude(ds => ds.Subject).ToList();
                model.CommercialExams.Add(StudentExams);
            }
            foreach (var student in ArtStudents)
            {
                var StudentExams = new StudentExams();
                StudentExams.StudentName = student.FullName;
                var Exams = _db.Exams.Where(e => e.StudentId == student.Id && e.TermId == CurrentTermId);
                StudentExams.Exams = Exams.Include(e => e.DepartmentSubject).ThenInclude(ds => ds.Subject).ToList();
                model.ArtExams.Add(StudentExams);
            }
            return(View(model));
        }