Update app.py
Browse files
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
|
| 86 |
else:
|
| 87 |
-
return
|
| 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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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()
|