Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@
"score": 1
},
]

def sort_scoreboard():
scoreboard.sort(key=lambda team: team["score"], reverse=True)

@app.route('/')
def show_scoreboard():
sort_scoreboard()
return render_template('scoreboard.html', scoreboard = scoreboard)

@app.route('/increase_score', methods=['GET', 'POST'])
Expand All @@ -50,7 +52,7 @@ def increase_score():
for team in scoreboard:
if team["id"] == team_id:
team["score"] += 1

sort_scoreboard()
return jsonify(scoreboard=scoreboard)


Expand Down