public AssessmentResultModel Map(IEnumerable<StudentAssessment> studentAssessments, DateTime startDate, DateTime endDate)
        {
            var assessmentResultModel = new AssessmentResultModel
            {
                DateRange = startDate.ToShortDateString() + " - " + endDate.ToShortDateString(),
                AssessmentResultRows =
                    studentAssessments.Select(sa => CreateAssessmentResultRow(sa, startDate, endDate)).ToList()
            };

            return assessmentResultModel;
        }
Пример #2
0
        public AssessmentResultModel Map(IEnumerable <StudentAssessment> studentAssessments, DateTime startDate, DateTime endDate)
        {
            var assessmentResultModel = new AssessmentResultModel
            {
                DateRange            = startDate.ToShortDateString() + " - " + endDate.ToShortDateString(),
                AssessmentResultRows =
                    studentAssessments.Select(sa => CreateAssessmentResultRow(sa, startDate, endDate)).ToList()
            };

            return(assessmentResultModel);
        }
Пример #3
0
        private AssessmentResultModel Result(int studentUsi, int? sessionId, int dayFrom = 1, int dayTo = 7)
        {

            var assessmentResultModel = new AssessmentResultModel();
            if (sessionId != null)
            {
                var session = _genericRepository.Get<Session>(s => s.SessionIdentity == sessionId);
                var startDate = session.BeginDate.AddDays(dayFrom - 1);
                var endDate = session.BeginDate.AddDays(dayTo - 1);

                var studentAssessments = _assessmentRepository.GetAssessmentResults(studentUsi, startDate, endDate);
                assessmentResultModel = _studentAssessmentsToAssessmentResultModelMapper.Map(studentAssessments, startDate, endDate);
                assessmentResultModel.Session = session.SessionName;
            }

            var student = _genericRepository.Get<Student>(s => s.StudentUSI == studentUsi);
            var profilePhotoUrl = _profilePhotoUrlFetcher.GetProfilePhotoUrlOrDefault(student);

            assessmentResultModel.Update(student, profilePhotoUrl, sessionId, dayFrom, dayTo);

            return assessmentResultModel;
        }