Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -95,13 +95,13 @@ def check_session_validity(check_id):
|
|
| 95 |
# If time difference is small, block access (previous user just finished)
|
| 96 |
if time_diff <= timedelta(minutes=SESSION_TIMEOUT_MINUTES):
|
| 97 |
error_msg = (
|
| 98 |
-
f"⚠️ The assistant is currently being used by another user \n\n"
|
| 99 |
-
f"It was detected that another user accessed this assistant just {time_diff.total_seconds()/60:.1f} minutes ago."
|
| 100 |
-
f"To protect the security of learning data and avoid conflicts, please try again later.\n\n"
|
| 101 |
-
f"We recommend waiting {SESSION_TIMEOUT_MINUTES} minutes before trying again, or: \n"
|
| 102 |
-
"1. Return to the Moodle course page\n"
|
| 103 |
-
"2. Click the "AI Learning Assistant" link again\n"
|
| 104 |
-
"3. The system will assign you a new assistant session\n\n"
|
| 105 |
"If the problem persists, please contact your instructor.",
|
| 106 |
)
|
| 107 |
print(f"[check_session_validity] Blocking access - Previous user ({last_student_id}) used assistant {time_diff.total_seconds()/60:.1f} minutes ago")
|
|
|
|
| 95 |
# If time difference is small, block access (previous user just finished)
|
| 96 |
if time_diff <= timedelta(minutes=SESSION_TIMEOUT_MINUTES):
|
| 97 |
error_msg = (
|
| 98 |
+
f"⚠️ The assistant is currently being used by another user \n\n",
|
| 99 |
+
f"It was detected that another user accessed this assistant just {time_diff.total_seconds()/60:.1f} minutes ago.",
|
| 100 |
+
f"To protect the security of learning data and avoid conflicts, please try again later.\n\n",
|
| 101 |
+
f"We recommend waiting {SESSION_TIMEOUT_MINUTES} minutes before trying again, or: \n",
|
| 102 |
+
"1. Return to the Moodle course page\n",
|
| 103 |
+
"2. Click the "AI Learning Assistant" link again\n",
|
| 104 |
+
"3. The system will assign you a new assistant session\n\n",
|
| 105 |
"If the problem persists, please contact your instructor.",
|
| 106 |
)
|
| 107 |
print(f"[check_session_validity] Blocking access - Previous user ({last_student_id}) used assistant {time_diff.total_seconds()/60:.1f} minutes ago")
|