Spaces:
Running
Running
fix ui issue and displayed only necessary data
Browse files
app.py
CHANGED
|
@@ -226,9 +226,6 @@ def get_activity_details(roll_no, reward_points_df):
|
|
| 226 |
|
| 227 |
# Format output in breakdown style
|
| 228 |
output = []
|
| 229 |
-
output.append("\n" + "=" * 80)
|
| 230 |
-
output.append("π INDIVIDUAL ACTIVITY BREAKDOWN")
|
| 231 |
-
output.append("=" * 80)
|
| 232 |
|
| 233 |
# Define all possible activity categories in order
|
| 234 |
activity_categories = [
|
|
@@ -283,8 +280,6 @@ def get_activity_details(roll_no, reward_points_df):
|
|
| 283 |
count = final_count.get(category, 0)
|
| 284 |
points = final_summary.get(category, 0.0)
|
| 285 |
|
| 286 |
-
output.append(f"π **{category}**")
|
| 287 |
-
output.append(f" Count: {count} | Points: {points:.2f}")
|
| 288 |
|
| 289 |
# Add any categories not in the standard list
|
| 290 |
for category, points in final_summary.items():
|
|
@@ -295,15 +290,9 @@ def get_activity_details(roll_no, reward_points_df):
|
|
| 295 |
|
| 296 |
# Add summary totals
|
| 297 |
output.append("")
|
| 298 |
-
output.append("=" * 80)
|
| 299 |
-
output.append(f"π Total Individual Activities: {len(student_rows)}")
|
| 300 |
-
output.append(f"π Total Activity Types: {len(final_summary)}")
|
| 301 |
-
output.append(f"π° Total Activity Points: {total_points:.2f}")
|
| 302 |
|
| 303 |
# Add detailed activity list if needed
|
| 304 |
if len(student_rows) <= 20: # Only show detailed list for reasonable number of activities
|
| 305 |
-
output.append("")
|
| 306 |
-
output.append("=" * 80)
|
| 307 |
output.append("π DETAILED ACTIVITY LIST")
|
| 308 |
output.append("=" * 80)
|
| 309 |
|
|
@@ -318,7 +307,7 @@ def get_activity_details(roll_no, reward_points_df):
|
|
| 318 |
points_val = 0
|
| 319 |
|
| 320 |
# Truncate long names for display
|
| 321 |
-
display_name = activity_name[:50] + "..." if len(activity_name) >
|
| 322 |
output.append(f"{idx:2d}. {activity_type}: {display_name} - {points_val:.2f} pts")
|
| 323 |
|
| 324 |
output.append("=" * 80)
|
|
@@ -761,7 +750,6 @@ def search_student(roll_no):
|
|
| 761 |
output.append(" Keep up the great work! π")
|
| 762 |
output.append(" Refer Reward points Breakdown for more details")
|
| 763 |
|
| 764 |
-
|
| 765 |
# MODIFIED: Add individual activity details from cached reward points data
|
| 766 |
activity_details = get_activity_details(roll_no, reward_points_df)
|
| 767 |
if activity_details:
|
|
|
|
| 226 |
|
| 227 |
# Format output in breakdown style
|
| 228 |
output = []
|
|
|
|
|
|
|
|
|
|
| 229 |
|
| 230 |
# Define all possible activity categories in order
|
| 231 |
activity_categories = [
|
|
|
|
| 280 |
count = final_count.get(category, 0)
|
| 281 |
points = final_summary.get(category, 0.0)
|
| 282 |
|
|
|
|
|
|
|
| 283 |
|
| 284 |
# Add any categories not in the standard list
|
| 285 |
for category, points in final_summary.items():
|
|
|
|
| 290 |
|
| 291 |
# Add summary totals
|
| 292 |
output.append("")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 293 |
|
| 294 |
# Add detailed activity list if needed
|
| 295 |
if len(student_rows) <= 20: # Only show detailed list for reasonable number of activities
|
|
|
|
|
|
|
| 296 |
output.append("π DETAILED ACTIVITY LIST")
|
| 297 |
output.append("=" * 80)
|
| 298 |
|
|
|
|
| 307 |
points_val = 0
|
| 308 |
|
| 309 |
# Truncate long names for display
|
| 310 |
+
display_name = activity_name[:50] + "..." if len(activity_name) > 63 else activity_name
|
| 311 |
output.append(f"{idx:2d}. {activity_type}: {display_name} - {points_val:.2f} pts")
|
| 312 |
|
| 313 |
output.append("=" * 80)
|
|
|
|
| 750 |
output.append(" Keep up the great work! π")
|
| 751 |
output.append(" Refer Reward points Breakdown for more details")
|
| 752 |
|
|
|
|
| 753 |
# MODIFIED: Add individual activity details from cached reward points data
|
| 754 |
activity_details = get_activity_details(roll_no, reward_points_df)
|
| 755 |
if activity_details:
|