Permalink
Browse files

Sort by users

  • Loading branch information...
1 parent ac15f28 commit 3fa5362087638e16a33289af4b2a0c15354e6c69 @MasseR committed Apr 14, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 code/Main.hs
View
@@ -174,7 +174,7 @@ thesisQuery = do
where
thesisInfo students credits thesis = let
studentsCourses = [(s, filter (\c -> creditStudentId c == studentId s) credits) | s <- M.elems students]
- eligibleStudents = filter ((> 0) . S.size . snd) [(studentId s, S.intersection (thesisCourses thesis) (S.fromList $ map creditId c) ) | (s,c) <- studentsCourses]
+ eligibleStudents = sortBy (compare `on` (S.size . snd)) $ filter ((> 0) . S.size . snd) [(studentId s, S.intersection (thesisCourses thesis) (S.fromList $ map creditId c) ) | (s,c) <- studentsCourses]
in object [
"thesis" .= thesis
, "eligibleStudents" .= eligibleStudents

0 comments on commit 3fa5362

Please sign in to comment.