elibrowne commited on
Commit
280d303
β€’
1 Parent(s): 46a842f
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -495,11 +495,11 @@ with gr.Blocks(theme = theme) as user_eval:
495
 
496
  def submit_email(email):
497
  user_id = email
498
- user_data = load_user_data(user_id) # calls login, downloads data, initializes session
499
  # After loading user data, update with current question
500
- current_question = load_current_question(user_data, user_id)
501
- new_answers = current_question["answers"].copy()
502
- new_answers[current_question["correct_answer_index"]] = "**" + current_question["answers"][current_question["correct_answer_index"]] + "** βœ…"
503
  return {
504
  question: gr.Row(visible = True),
505
  login: gr.Row(visible = False),
@@ -524,8 +524,8 @@ with gr.Blocks(theme = theme) as user_eval:
524
  c: gr.Button(current_question["answers"][2]),
525
  d: gr.Button(current_question["answers"][3]),
526
  user_id: user_id,
527
- user_data: user_data,
528
- current_question: current_question
529
  }
530
  s.click(fn = submit_email, inputs = [email], outputs = [question, login, selection, passage_display, q_text, a, b, c, d, user_id, user_data, current_question])
531
 
 
495
 
496
  def submit_email(email):
497
  user_id = email
498
+ loaded_data = load_user_data(user_id) # calls login, downloads data, initializes session
499
  # After loading user data, update with current question
500
+ new_q = load_current_question(loaded_data, user_id)
501
+ new_answers = new_q["answers"].copy()
502
+ new_answers[new_q["correct_answer_index"]] = "**" + new_q["answers"][new_q["correct_answer_index"]] + "** βœ…"
503
  return {
504
  question: gr.Row(visible = True),
505
  login: gr.Row(visible = False),
 
524
  c: gr.Button(current_question["answers"][2]),
525
  d: gr.Button(current_question["answers"][3]),
526
  user_id: user_id,
527
+ user_data: loaded_data,
528
+ current_question: new_q
529
  }
530
  s.click(fn = submit_email, inputs = [email], outputs = [question, login, selection, passage_display, q_text, a, b, c, d, user_id, user_data, current_question])
531