diff --git a/server.py b/server.py index 372a266c..0d4dee97 100644 --- a/server.py +++ b/server.py @@ -51,6 +51,7 @@ def increase_score(): if team["id"] == team_id: team["score"] += 1 + scoreboard.sort(key = lambda t: t["score"], reverse = True) return jsonify(scoreboard=scoreboard) diff --git a/static/scoreboard.js b/static/scoreboard.js index 34ce2009..5c7503b6 100644 --- a/static/scoreboard.js +++ b/static/scoreboard.js @@ -32,7 +32,7 @@ function increase_score(id){ contentType: "application/json; charset=utf-8", data : JSON.stringify(team_id), success: function(result){ - + display_scoreboard(result.scoreboard) }, error: function(request, status, error){ console.log("Error");