diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..2a585e0c --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.venv/ +__pycache__/ +*.pyc \ No newline at end of file diff --git a/server.py b/server.py index 372a266c..0cb04aa9 100644 --- a/server.py +++ b/server.py @@ -51,6 +51,8 @@ def increase_score(): if team["id"] == team_id: team["score"] += 1 + scoreboard.sort(key=lambda team: team["score"], reverse=True) + return jsonify(scoreboard=scoreboard) diff --git a/static/scoreboard.js b/static/scoreboard.js index 34ce2009..0652703f 100644 --- a/static/scoreboard.js +++ b/static/scoreboard.js @@ -32,6 +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){