Created
May 29, 2013 17:58
-
-
Save anlai/5672313 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
model.SectionDetails = (from section in repositoryFactory.SectionRepository.Queryable | |
let sequence = section.Course.CrossListedCourse == null ? section.Sequence : string.Format("{0} ({1} {2})", section.Sequence, section.Course.Subject, section.Course.CourseNumb) | |
let students = (decimal)section.ClassTimes.SelectMany(a => a.Students).Select(a => a.LoginId).Distinct().Count() | |
let responses = (decimal)section.ClassTimes.SelectMany(a => a.ClassTimeEvaluations).SelectMany(a => a.EvaluationResponses).Count() | |
let evals = section.ClassTimes.SelectMany(a => a.ClassTimeEvaluations).Count() | |
let instructors = section.ClassTimes.SelectMany(a => a.Instructors) | |
where section.Course == course || section.Course.CrossListedCourse == course | |
select new SectionDetail() { SectionId = section.Id, Sequence = sequence, | |
Students = (int)students, ResponseRate = ((responses)/(students*evals))*100, | |
InstructorList = instructors} | |
).ToList(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment