burtenshaw commited on
Commit
acbda2a
·
1 Parent(s): abfd25a

check for profile

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -145,12 +145,17 @@ def push_results_to_hub(user_answers, token: gr.OAuthToken | None):
145
 
146
 
147
  def handle_quiz(
148
- question_idx, user_answers, selected_answer, is_start, token: gr.OAuthToken | None
 
 
 
 
 
149
  ):
150
  """
151
  Handle quiz state transitions and store answers
152
  """
153
- if token is None:
154
  gr.Warning("Please log in to Hugging Face before starting the quiz!")
155
  return
156
 
 
145
 
146
 
147
  def handle_quiz(
148
+ question_idx,
149
+ user_answers,
150
+ selected_answer,
151
+ is_start,
152
+ token: gr.OAuthToken | None,
153
+ profile: gr.OAuthProfile | None,
154
  ):
155
  """
156
  Handle quiz state transitions and store answers
157
  """
158
+ if token is None or profile is None:
159
  gr.Warning("Please log in to Hugging Face before starting the quiz!")
160
  return
161