From 2e7489f2b160fad6183af3f52a81f42619f601a8 Mon Sep 17 00:00:00 2001 From: JueWang268 Date: Tue, 9 Dec 2025 00:04:08 -0500 Subject: [PATCH] Jue Wang jw4822 --- server.py | 2 ++ static/scoreboard.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index 372a266c..a97be43d 100644 --- a/server.py +++ b/server.py @@ -50,6 +50,8 @@ def increase_score(): for team in scoreboard: if team["id"] == team_id: team["score"] += 1 + + scoreboard = sorted(scoreboard, key=lambda x: x['score'], reverse=True) return jsonify(scoreboard=scoreboard) diff --git a/static/scoreboard.js b/static/scoreboard.js index 34ce2009..46fd669a 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");