Ko-TTS-Arena Contributors commited on
Commit
039754c
·
1 Parent(s): 2f8de6f

feat: Replace avg votes per user with total evaluation time

Browse files
Files changed (2) hide show
  1. models.py +8 -3
  2. templates/leaderboard.html +3 -3
models.py CHANGED
@@ -701,8 +701,12 @@ def get_voting_statistics():
701
  # Total number of votes
702
  total_votes = Vote.query.count()
703
 
704
- # Average votes per user
705
- avg_votes_per_user = round(total_votes / total_voters, 1) if total_voters > 0 else 0
 
 
 
 
706
 
707
  # Total characters evaluated (sum of text lengths)
708
  total_characters = db.session.query(func.sum(func.length(Vote.text))).scalar() or 0
@@ -721,7 +725,8 @@ def get_voting_statistics():
721
  return {
722
  "total_voters": total_voters,
723
  "total_votes": total_votes,
724
- "avg_votes_per_user": avg_votes_per_user,
 
725
  "total_characters": total_characters,
726
  "votes_last_24h": votes_last_24h,
727
  "votes_last_7d": votes_last_7d,
 
701
  # Total number of votes
702
  total_votes = Vote.query.count()
703
 
704
+ # Total evaluation time in seconds (sum of session durations)
705
+ total_eval_seconds = db.session.query(func.sum(Vote.session_duration_seconds)).scalar() or 0
706
+
707
+ # Convert to hours, minutes format
708
+ total_eval_hours = int(total_eval_seconds // 3600)
709
+ total_eval_minutes = int((total_eval_seconds % 3600) // 60)
710
 
711
  # Total characters evaluated (sum of text lengths)
712
  total_characters = db.session.query(func.sum(func.length(Vote.text))).scalar() or 0
 
725
  return {
726
  "total_voters": total_voters,
727
  "total_votes": total_votes,
728
+ "total_eval_hours": total_eval_hours,
729
+ "total_eval_minutes": total_eval_minutes,
730
  "total_characters": total_characters,
731
  "votes_last_24h": votes_last_24h,
732
  "votes_last_7d": votes_last_7d,
templates/leaderboard.html CHANGED
@@ -1137,10 +1137,10 @@
1137
  </div>
1138
 
1139
  <div class="stat-card accent">
1140
- <div class="stat-icon">📈</div>
1141
  <div class="stat-content">
1142
- <div class="stat-value">{{ voting_stats.avg_votes_per_user }}</div>
1143
- <div class="stat-label">인당 평균 투표</div>
1144
  </div>
1145
  </div>
1146
 
 
1137
  </div>
1138
 
1139
  <div class="stat-card accent">
1140
+ <div class="stat-icon">⏱️</div>
1141
  <div class="stat-content">
1142
+ <div class="stat-value">{% if voting_stats.total_eval_hours > 0 %}{{ voting_stats.total_eval_hours }}시간 {% endif %}{{ voting_stats.total_eval_minutes }}분</div>
1143
+ <div class="stat-label">총 평가 시간</div>
1144
  </div>
1145
  </div>
1146