/// <summary> /// Gets all student assignment submissions. /// </summary> /// <param name="studentId">The student id.</param> /// <param name="displayFilter">The display filter.</param> /// <param name="courseId">The course id.</param> /// <returns></returns> public List <AssignmentSubmissionViewModel> GetAllStudentAssignmentSubmissions(int studentId, StudentAssignmentFilterType displayFilter = StudentAssignmentFilterType.Active, int courseId = 0) { List <AssignmentSubmissionViewModel> models = new List <AssignmentSubmissionViewModel>(); try { List <Assignment> assignments = AssignmentManager.GetAllAssignmentsByStudentAndCourse(studentId, displayFilter, courseId); models = AssignmentSubmissionViewModelFactory.CreateStudentAssignmentSubmissionViewModels(assignments, studentId, ObjectMapper); } catch (Exception ex) { ExceptionManager.HandleException(ex, PolicyNameType.ExceptionReplacing); } return(models); }
/// <summary> /// Gets all student upcoming task and assignment deadlines. /// </summary> /// <param name="studentId">The student id.</param> /// <returns></returns> public List <TaskAssignmentViewModel> GetAllStudentUpcomingTaskAndAssignmentDeadlines(int studentId) { List <TaskAssignmentViewModel> models = new List <TaskAssignmentViewModel>(); try { List <BaseTask> deadlineList = new List <BaseTask>(); deadlineList.AddRange(AssignmentManager.GetAllAssignmentsByStudentAndCourse(studentId, StudentAssignmentFilterType.Active, 0)); deadlineList.AddRange(TaskManager.GetTasksWithUpcomingDeadlinesByUser(studentId)); models = ObjectMapper.Map <Model.Entities.BaseTask, TaskAssignmentViewModel>(deadlineList.OrderBy(d => d.DaysDue).ToList()); } catch (Exception ex) { ExceptionManager.HandleException(ex, PolicyNameType.ExceptionReplacing); } return(models); }