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