Skip to content

Commit

Permalink
21 - Matching Algorithm Part 2 - Awarding Points
Browse files Browse the repository at this point in the history
  • Loading branch information
jmitchel3 committed Jul 14, 2015
1 parent bb3eac0 commit db94bbe
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/questions/matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,18 @@ def get_match(user_a, user_b):
user_a_pref = user_a_answers.their_answer
user_b_answer = user_b_answers.my_answer
user_b_pref = user_b_answers.their_answer
user_a_total_awarded = 0
user_b_total_awarded = 0
if user_a_answer == user_b_pref:
user_b_total_awarded += user_b_answers.their_points
print "%s fits with %s's preference" %(user_a_answers.user.username, user_b_answers.user.username)
if user_a_pref == user_b_answer:
user_a_total_awarded += user_a_answers.their_points
print "%s fits with %s's preference" %(user_a_answers.user.username, user_b_answers.user.username)
if user_a_answer == user_b_pref and user_a_pref == user_b_answer:
print "this is an ideal answer for both"
print user_a, user_a_total_awarded, user_b
print user_b, user_b_total_awarded, user_a



Expand Down

0 comments on commit db94bbe

Please sign in to comment.