 
         kept
 
-      kept = keepHelper(submissions, keepHighest, ([a,xx], [b,yy]) -> b - a)
-      kept = keepHelper(kept, keepLowest, ([a,xx], [b,yy]) -> a - b)
+      kept = keepHelper(submissions, keepHighest, @stableSubmissionSort(
+        ([a,xx], [b,yy]) -> b - a,
+        ([_score,s]) -> s.submission.assignment_id
+      ))
+      kept = keepHelper(kept, keepLowest, @stableSubmissionSort(
+        ([a,xx], [b,yy]) -> a - b,
+        ([_score,s]) -> s.submission.assignment_id
+      ))
 
     @estimateQHigh: (pointed, unpointed, grades) ->
       if unpointed.length > 0

      kept

    @dropUnpointed: (submissions, keepHighest, keepLowest) ->
      sortedSubmissions = submissions.sort (a,b) -> a.score - b.score
      _.chain(sortedSubmissions).last(keepHighest).first(keepLowest).value()

    @dropPointed: (submissions, cantDrop, keepHighest, keepLowest) ->

      keepHighest = submissions.length - dropLowest
      keepLowest  = keepHighest - dropHighest

      hasPointed = (s.total for s in submissions when s.total > 0).length > 0
      kept = if hasPointed
        @dropPointed submissions, cantDrop, keepHighest, keepLowest
