Spaces:
Running
Running
used balace points to check the reward points difference b/w year average
Browse files
app.py
CHANGED
|
@@ -187,9 +187,8 @@ spreadsheet = client.open_by_key(SHEET_ID)
|
|
| 187 |
sheet_configs = [
|
| 188 |
# Original sheets
|
| 189 |
{"gid": 688907204, "name": "AIML"},
|
| 190 |
-
{"gid": 451167295, "name": "
|
| 191 |
-
{"gid": 1955995189, "name": "
|
| 192 |
-
# New sheets
|
| 193 |
{"gid": 821473193, "name": "Sheet_4"},
|
| 194 |
{"gid": 1798819643, "name": "Sheet_5"},
|
| 195 |
{"gid": 1057532042, "name": "Sheet_6"},
|
|
@@ -369,6 +368,9 @@ def search_student(roll_no):
|
|
| 369 |
if student.empty:
|
| 370 |
return f"❌ Roll No '{roll_no}' not found in any sheet"
|
| 371 |
|
|
|
|
|
|
|
|
|
|
| 372 |
record = student.iloc[0].to_dict()
|
| 373 |
student_year = str(record.get('YEAR', '')).strip()
|
| 374 |
|
|
@@ -389,7 +391,7 @@ def search_student(roll_no):
|
|
| 389 |
|
| 390 |
# Get student's current points (clean numeric value)
|
| 391 |
try:
|
| 392 |
-
student_points_str = str(record.get('
|
| 393 |
student_points = float(student_points_str) if student_points_str else 0
|
| 394 |
except:
|
| 395 |
student_points = 0
|
|
|
|
| 187 |
sheet_configs = [
|
| 188 |
# Original sheets
|
| 189 |
{"gid": 688907204, "name": "AIML"},
|
| 190 |
+
{"gid": 451167295, "name": "AIDS"},
|
| 191 |
+
{"gid": 1955995189, "name": "Sheet_3"},
|
|
|
|
| 192 |
{"gid": 821473193, "name": "Sheet_4"},
|
| 193 |
{"gid": 1798819643, "name": "Sheet_5"},
|
| 194 |
{"gid": 1057532042, "name": "Sheet_6"},
|
|
|
|
| 368 |
if student.empty:
|
| 369 |
return f"❌ Roll No '{roll_no}' not found in any sheet"
|
| 370 |
|
| 371 |
+
# Log to see which roll number is asked by user
|
| 372 |
+
print("Roll No Searched:", roll_no)
|
| 373 |
+
|
| 374 |
record = student.iloc[0].to_dict()
|
| 375 |
student_year = str(record.get('YEAR', '')).strip()
|
| 376 |
|
|
|
|
| 391 |
|
| 392 |
# Get student's current points (clean numeric value)
|
| 393 |
try:
|
| 394 |
+
student_points_str = str(record.get('BALANCE POINTS', '')).replace(',', '').strip()
|
| 395 |
student_points = float(student_points_str) if student_points_str else 0
|
| 396 |
except:
|
| 397 |
student_points = 0
|