0Learn commited on
Commit
c57d876
·
verified ·
1 Parent(s): b7cbf84

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -82,9 +82,9 @@ def check_answer(answer):
82
  if answer == question_bank[game_state["current_question"]]["answer"]:
83
  game_state["score"] += 1
84
  game_state["current_question"] += 1
85
- return True
86
  else:
87
- return False
88
 
89
  def use_help_line(help_line):
90
  if help_line == "50:50":
@@ -117,4 +117,10 @@ with gr.Blocks() as demo:
117
  help_line_clue.click(use_help_line, inputs=[clue_button], outputs=[result])
118
  demo.load(get_next_question, inputs=[], outputs=[question, options, score])
119
 
120
- demo.launch()
 
 
 
 
 
 
 
82
  if answer == question_bank[game_state["current_question"]]["answer"]:
83
  game_state["score"] += 1
84
  game_state["current_question"] += 1
85
+ return "Correct!"
86
  else:
87
+ return "Incorrect!"
88
 
89
  def use_help_line(help_line):
90
  if help_line == "50:50":
 
117
  help_line_clue.click(use_help_line, inputs=[clue_button], outputs=[result])
118
  demo.load(get_next_question, inputs=[], outputs=[question, options, score])
119
 
120
+ def update_game_state():
121
+ game_state["current_question"] += 1
122
+ return get_next_question()
123
+
124
+ demo.load(update_game_state, inputs=[], outputs=[question, options, score], every=1)
125
+
126
+ demo.launch()