Spaces:
Running
Running
leaderboard: use the explicit score tier recorded in each judgement
Browse files- rt_challenge.py +6 -2
rt_challenge.py
CHANGED
|
@@ -260,8 +260,12 @@ def leaderboard():
|
|
| 260 |
fam = int(j.get("families", 0) or 0)
|
| 261 |
# a dangerous-command / shell-advisory family (the kernel still denies) scores as a shell-check family (tier B, 5 points),
|
| 262 |
# whether it was filed as B-shell or as S-exec; this matches the judgement notices (discussion #2)
|
| 263 |
-
|
| 264 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 265 |
else:
|
| 266 |
n = 1
|
| 267 |
r[tier] = r.get(tier, 0) + n
|
|
|
|
| 260 |
fam = int(j.get("families", 0) or 0)
|
| 261 |
# a dangerous-command / shell-advisory family (the kernel still denies) scores as a shell-check family (tier B, 5 points),
|
| 262 |
# whether it was filed as B-shell or as S-exec; this matches the judgement notices (discussion #2)
|
| 263 |
+
# the judgement records its score tier explicitly: "B" = the shell / dangerous-command check missed it while the
|
| 264 |
+
# kernel still denied (5 points per family); "S" = the kernel itself returned ALLOW (full value)
|
| 265 |
+
if j.get("tier") in ("S", "A", "B"):
|
| 266 |
+
tier = j["tier"]
|
| 267 |
+
if tier == "B":
|
| 268 |
+
n = max(1, min(fam or 1, 10))
|
| 269 |
else:
|
| 270 |
n = 1
|
| 271 |
r[tier] = r.get(tier, 0) + n
|