From 868aa36469de46f502e0ec3a5f6c544ad01d3d75 Mon Sep 17 00:00:00 2001 From: shreyarora2198 <32587504+shreyarora2198@users.noreply.github.com> Date: Mon, 8 Dec 2025 23:46:11 -0500 Subject: [PATCH] Shrey Arora (ska2153) CBL --- server.py | 2 ++ static/scoreboard.js | 1 + 2 files changed, 3 insertions(+) diff --git a/server.py b/server.py index 372a266c..f0fafb22 100644 --- a/server.py +++ b/server.py @@ -51,6 +51,8 @@ def increase_score(): if team["id"] == team_id: team["score"] += 1 + # sort the scoreboard by score in descending order + 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..f7f096b4 100644 --- a/static/scoreboard.js +++ b/static/scoreboard.js @@ -33,6 +33,7 @@ function increase_score(id){ data : JSON.stringify(team_id), success: function(result){ + display_scoreboard(result.scoreboard); // show the updated scoreboard }, error: function(request, status, error){ console.log("Error");