public RealExam[] GetAllPastStudentExams(RealExamProxy realExamProxy, int studentId) { List <StudentExam> allExams = studentExamController.GetAllStudentExams(studentId); List <RealExam> allRealExams = new List <RealExam>(); foreach (StudentExam exam in allExams) { allRealExams.Add(realExamProxy.GetStudentExam(exam.Id)); } return(allRealExams.ToArray()); }
public void DeleteStudent(int userId) { List <SubArea> userSubAreas = subAreaController.GetUserSubAreas(userId); ResetSubAreasProxy(userSubAreas); List <string> assignmentsToDelete = SubAreaUtils.GetSubAreasStrings(userSubAreas).ToList(); SubAreaAssignUtils.UnAssignSubAreasToUser(userId, subAreaController, assignmentsToDelete.ToArray()); StudentExamController studentExamController = new StudentExamController(); StudentExamQuestionController studentExamQuestionController = new StudentExamQuestionController(); List <StudentExam> allStudentExamIds = studentExamController.GetAllStudentExams(userId); foreach (StudentExam studentExam in allStudentExamIds) { studentExamQuestionController.DeleteAllStudentExamQuestions(studentExam.Id); studentExamController.DeleteStudentExam(studentExam.Id); } userController.DeleteStudent(userId); }