Skip to content

Commit

Permalink
Add trim of students in project to matches
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Monroe committed Oct 15, 2017
1 parent 516d4b4 commit d099701
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions teamwork/apps/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,20 @@
match: the list of matched students
returns: a sorted list of students from best score to worst
"""
def sort(matchList):
def sort(course, matchList):
matches = []
skip = False
topScores = sorted(matchList.values())
for j in reversed(topScores):
for u, i in matchList.items():
if j == i:
matches.append((u,i))
print(list(u.membership.all()))
for k in list(u.membership.all()):
print(k.course.first())
if k.course.first() == course:
skip = True
if not skip:
matches.append((u,i))
return matches


Expand Down Expand Up @@ -113,9 +120,9 @@ def po_match(project):
for l in initial.keys():
temp = by_schedule(l, project)
initial[l][0] += temp
initial[l][4] += temp
initial[l][4] += temp

return sort(initial)
return sort(course, initial)
# past classes match

def auto_ros(course):
Expand Down

0 comments on commit d099701

Please sign in to comment.