Update app.py
Browse files
app.py
CHANGED
@@ -10,8 +10,8 @@ USERS = ["June", "Sean", "Woojoo", "Taejoo", "Dummy"]
|
|
10 |
QUESTION_TEMPLATE = {"question": "λ€μ ν¬μΌλͺ¬μ μ΄λ¦μ λκΉμ?![]({img_url})", "answer": "{name}"}
|
11 |
|
12 |
def get_question_answer():
|
13 |
-
a = random.randint(0,
|
14 |
-
b = random.randint(0,
|
15 |
c = a + b
|
16 |
q = f"$${a} + {b} = \square$$"
|
17 |
a = f"{c}"
|
@@ -34,7 +34,7 @@ with gr.Blocks() as demo:
|
|
34 |
with gr.Row():
|
35 |
with gr.Column():
|
36 |
markdown = gr.Markdown(MD.format(content=''))
|
37 |
-
user = gr.Radio(USERS, value="
|
38 |
quiz_count = gr.Radio([10, 20, 30], value=10, label="μ΄ ν΄μ¦ κ°μ", info="ν΄μ¦λ₯Ό λͺ κ° ν μμ μΈκ°μ?")
|
39 |
with gr.Column():
|
40 |
with gr.Row():
|
@@ -66,7 +66,7 @@ with gr.Blocks() as demo:
|
|
66 |
answer.value = a
|
67 |
info[user]['score'] += 1
|
68 |
info[user]['count'] += 1
|
69 |
-
bot_message = f"πμ λ΅μ
λλ€! λ€μ λ¬Έμ μ
λλ€.\n- νμ¬ μ μ: {info[user]['score']}μ \n- μμ μκ°: {time.time() - info[user]['time']:4.3f}μ΄\n
|
70 |
|
71 |
elif "ν΄μ¦μ’
λ£" == message.replace(" ", ""):
|
72 |
bot_message = f"ν΄μ¦λ₯Ό κ°μ μ’
λ£ν©λλ€."
|
|
|
10 |
QUESTION_TEMPLATE = {"question": "λ€μ ν¬μΌλͺ¬μ μ΄λ¦μ λκΉμ?![]({img_url})", "answer": "{name}"}
|
11 |
|
12 |
def get_question_answer():
|
13 |
+
a = random.randint(0, 5)
|
14 |
+
b = random.randint(0, 6)
|
15 |
c = a + b
|
16 |
q = f"$${a} + {b} = \square$$"
|
17 |
a = f"{c}"
|
|
|
34 |
with gr.Row():
|
35 |
with gr.Column():
|
36 |
markdown = gr.Markdown(MD.format(content=''))
|
37 |
+
user = gr.Radio(USERS, value="Taejoo", label="μ¬μ©μ", info="λΉμ μ λꡬμ κ°μ?")
|
38 |
quiz_count = gr.Radio([10, 20, 30], value=10, label="μ΄ ν΄μ¦ κ°μ", info="ν΄μ¦λ₯Ό λͺ κ° ν μμ μΈκ°μ?")
|
39 |
with gr.Column():
|
40 |
with gr.Row():
|
|
|
66 |
answer.value = a
|
67 |
info[user]['score'] += 1
|
68 |
info[user]['count'] += 1
|
69 |
+
bot_message = f"πμ λ΅μ
λλ€! λ€μ λ¬Έμ μ
λλ€.\n- νμ¬ μ μ: {info[user]['score']}μ \n- μμ μκ°: {time.time() - info[user]['time']:4.3f}μ΄\nλΉμΉΈμ λ€μ΄κ° μ«μλ₯Ό λ§μΆ°μ£ΌμΈμ.{q}"
|
70 |
|
71 |
elif "ν΄μ¦μ’
λ£" == message.replace(" ", ""):
|
72 |
bot_message = f"ν΄μ¦λ₯Ό κ°μ μ’
λ£ν©λλ€."
|