Update app.py
Browse files
app.py
CHANGED
@@ -10,8 +10,8 @@ USERS = ["June", "Sean", "Woojoo", "Taejoo", "Dummy"]
|
|
10 |
QUESTION_TEMPLATE = {"question": "๋ค์ ํฌ์ผ๋ชฌ์ ์ด๋ฆ์ ๋ญ๊น์?", "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": "๋ค์ ํฌ์ผ๋ชฌ์ ์ด๋ฆ์ ๋ญ๊น์?", "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"ํด์ฆ๋ฅผ ๊ฐ์ ์ข
๋ฃํฉ๋๋ค."
|