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"ν€΄μ¦ˆλ₯Ό κ°•μ œ μ’…λ£Œν•©λ‹ˆλ‹€."