yoon-gu commited on
Commit
c938c12
ยท
1 Parent(s): e0b73a8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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, 10)
14
- b = random.randint(0, 10)
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="Dummy", label="์‚ฌ์šฉ์ž", info="๋‹น์‹ ์€ ๋ˆ„๊ตฌ์‹ ๊ฐ€์š”?")
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. ๋นˆ์นธ์— ๋“ค์–ด๊ฐˆ ์ˆซ์ž๋ฅผ ๋งž์ถฐ์ฃผ์„ธ์š”.{q}"
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"ํ€ด์ฆˆ๋ฅผ ๊ฐ•์ œ ์ข…๋ฃŒํ•ฉ๋‹ˆ๋‹ค."