Skip to content

Commit

Permalink
adding print statements in getScores
Browse files Browse the repository at this point in the history
  • Loading branch information
pmarathay committed Dec 6, 2024
1 parent 605f9ce commit 06cd8f9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions caption_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1597,6 +1597,7 @@ def get(self, game_code, round_number):

class getScores(Resource):
def get(self, game_code, round_number):
print("In getScores")
# print("requested game_code: ", game_code)
# response = {}
# items = {}
Expand Down Expand Up @@ -1628,6 +1629,7 @@ def get(self, game_code, round_number):
response = {}
items = {}
try:
print("In Try")
conn = connect()
get_game_score = '''
SELECT round_user_uid, SUM(score) as game_score FROM captions.round
Expand All @@ -1636,7 +1638,7 @@ def get(self, game_code, round_number):
GROUP BY round_user_uid
'''
game_score = execute(get_game_score, "get", conn)
# print("game_score_info:", game_score)
print("game_score_info:", game_score)
if game_score["code"] == 280:
get_score_query = '''
SELECT captions.round.round_user_uid, captions.user.user_alias,
Expand All @@ -1649,7 +1651,7 @@ def get(self, game_code, round_number):
AND round_number=\'''' + round_number + '''\'
'''
scoreboard = execute(get_score_query, "get", conn)
# print("score info: ", scoreboard)
print("score info: ", scoreboard)
if scoreboard["code"] == 280:
response["message"] = "280, scoreboard is updated and get_score_board request " \
"successful."
Expand All @@ -1662,6 +1664,7 @@ def get(self, game_code, round_number):
response["scoreboard"] = scoreboard["result"]
return response, 200
except:
print("In except")
raise BadRequest("Get scoreboard request failed")
finally:
disconnect(conn)
Expand Down

0 comments on commit 06cd8f9

Please sign in to comment.