Kerikim commited on
Commit
c66a2d3
·
1 Parent(s): 1ffd314

elkay frontend game xp

Browse files
Files changed (1) hide show
  1. dashboards/student_db.py +2 -1
dashboards/student_db.py CHANGED
@@ -159,7 +159,8 @@ def show_student_dashboard():
159
  level += 1
160
  into = 0
161
 
162
- pct = 0 if need <= 0 else min(100, int(round((into / need) * 100)))
 
163
 
164
  st.markdown(
165
  f"""
 
159
  level += 1
160
  into = 0
161
 
162
+ cap = max(500, ((xp // 500) + 1) * 500) # next threshold
163
+ pct = 0 if cap <= 0 else min(100, int(round(100 * xp / cap)))
164
 
165
  st.markdown(
166
  f"""