public async Task <IActionResult> TestScore()
        {
            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 AllDepartmentsTests();

            model.ScienceTests    = new List <StudentTests>();
            model.CommercialTests = new List <StudentTests>();
            model.ArtTests        = new List <StudentTests>();
            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 StudentTests = new StudentTests();
                StudentTests.StudentName = student.FullName;
                var Test = _context.Tests.Where(e => e.StudentId == student.Id && e.TermId == CurrentTermId);
                StudentTests.Tests = Test.Include(e => e.DepartmentSubject).ThenInclude(ds => ds.Subject).ToList();
                model.ScienceTests.Add(StudentTests);
            }
            foreach (var student in CommercialStudents)
            {
                var StudentTests = new StudentTests();
                StudentTests.StudentName = student.FullName;
                var Tests = _context.Tests.Where(e => e.StudentId == student.Id && e.TermId == CurrentTermId);
                StudentTests.Tests = Tests.Include(e => e.DepartmentSubject).ThenInclude(ds => ds.Subject).ToList();
                model.CommercialTests.Add(StudentTests);
            }
            foreach (var student in ArtStudents)
            {
                var StudentTests = new StudentTests();
                StudentTests.StudentName = student.FullName;
                var Tests = _context.Tests.Where(e => e.StudentId == student.Id && e.TermId == CurrentTermId);
                StudentTests.Tests = Tests.Include(e => e.DepartmentSubject).ThenInclude(ds => ds.Subject).ToList();
                model.ArtTests.Add(StudentTests);
            }
            return(View(model));
        }
        public IActionResult ClassTests(int Id)
        {
            var Class = _db.Classes.Find(Id);

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

            model.ScienceTests    = new List <StudentTests>();
            model.CommercialTests = new List <StudentTests>();
            model.ArtTests        = new List <StudentTests>();
            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 StudentTests = new StudentTests();
                StudentTests.StudentName = student.FullName;
                var Test = _db.Tests.Where(e => e.StudentId == student.Id && e.TermId == CurrentTermId);
                StudentTests.Tests = Test.Include(e => e.DepartmentSubject).ThenInclude(ds => ds.Subject).ToList();
                model.ScienceTests.Add(StudentTests);
            }
            foreach (var student in CommercialStudents)
            {
                var StudentTests = new StudentTests();
                StudentTests.StudentName = student.FullName;
                var Tests = _db.Tests.Where(e => e.StudentId == student.Id && e.TermId == CurrentTermId);
                StudentTests.Tests = Tests.Include(e => e.DepartmentSubject).ThenInclude(ds => ds.Subject).ToList();
                model.CommercialTests.Add(StudentTests);
            }
            foreach (var student in ArtStudents)
            {
                var StudentTests = new StudentTests();
                StudentTests.StudentName = student.FullName;
                var Tests = _db.Tests.Where(e => e.StudentId == student.Id && e.TermId == CurrentTermId);
                StudentTests.Tests = Tests.Include(e => e.DepartmentSubject).ThenInclude(ds => ds.Subject).ToList();
                model.ArtTests.Add(StudentTests);
            }
            return(View(model));
        }