mirror of
https://github.com/aljazceru/CTFd.git
synced 2026-02-23 15:14:49 +01:00
Add a bell curve graph and total points calculation (#1325)
* Add a bell curve graph and total points calculation to admin panel statistics * Closes #608
This commit is contained in:
@@ -31,6 +31,13 @@ def statistics():
|
||||
|
||||
challenge_count = Challenges.query.count()
|
||||
|
||||
total_points = (
|
||||
Challenges.query.with_entities(db.func.sum(Challenges.value).label("sum"))
|
||||
.filter_by(state="visible")
|
||||
.first()
|
||||
.sum
|
||||
) or 0
|
||||
|
||||
ip_count = Tracking.query.with_entities(Tracking.ip).distinct().count()
|
||||
|
||||
solves_sub = (
|
||||
@@ -73,6 +80,7 @@ def statistics():
|
||||
wrong_count=wrong_count,
|
||||
solve_count=solve_count,
|
||||
challenge_count=challenge_count,
|
||||
total_points=total_points,
|
||||
solve_data=solve_data,
|
||||
most_solved=most_solved,
|
||||
least_solved=least_solved,
|
||||
|
||||
Reference in New Issue
Block a user