arxivgpt kim commited on
Commit
6b8f1f9
โ€ข
1 Parent(s): 8467a64

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -106,8 +106,8 @@ scores = [[1, 0],
106
 
107
  def calculate_score(*answers):
108
  total_score = sum([scores[i][options[i].index(answer)] for i, answer in enumerate(answers)])
109
- grade, definition = get_grade(total_score) # ๋“ฑ๊ธ‰๊ณผ ์ •์˜๋ฅผ ์–ป๊ธฐ ์œ„ํ•œ ํ•จ์ˆ˜ ํ˜ธ์ถœ
110
- return total_score, grade, definition # ์ด์ , ๋“ฑ๊ธ‰, ๋“ฑ๊ธ‰ ์ •์˜๋ฅผ ๋ฐ˜ํ™˜
111
 
112
 
113
  def get_grade(total_score):
@@ -123,9 +123,11 @@ def get_grade(total_score):
123
 
124
  for grade, (low, high, definition) in grades.items():
125
  if low <= converted_score <= high:
126
- return grade, definition # ๋“ฑ๊ธ‰๊ณผ ์ •์˜๋ฅผ ํ•จ๊ป˜ ๋ฐ˜ํ™˜
127
- return "No Grade", "" # ๋“ฑ๊ธ‰์„ ์ฐพ์„ ์ˆ˜ ์—†๋Š” ๊ฒฝ์šฐ
128
 
 
 
129
  css = """
130
  footer {
131
  visibility: hidden;
@@ -202,9 +204,9 @@ button:hover {
202
 
203
 
204
  with gr.Blocks(css=css) as demo:
205
- gr.Markdown("# ์ฝ”๋ ˆ์ดํŒ…(KORating) ์…€ํ”„ ์ง„๋‹จ ์„œ๋น„์Šค", elem_id="title") # ํƒ€์ดํ‹€
206
- gr.Markdown("### ๋””์ง€ํ„ธ์ž์‚ฐ ์ธ์ฆํ‰๊ฐ€์˜ ๋ฆฌ๋” '์ฝ”๋ ˆ์ดํŒ…'(KORating) ์…€ํ”„ ์ง„๋‹จ ์„œ๋น„์Šค๋Š”, ํˆฌ์ž์ž ๋ณดํ˜ธ ๋ฐ ๊ฑด์ „ํ•œ ๊ฐ€์ƒ์ž์‚ฐ ์ƒํƒœ๊ณ„ ๊ตฌ์ถ•์„ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค.", elem_id="description1") # ์„ค๋ช…๊ธ€ 1
207
- gr.Markdown("### ๊ธฐ๋ณธ ์ •๋ณด ์ž…๋ ฅ ํ›„ ์ด 8๋‹จ๊ณ„ TAP(1๋‹จ๊ณ„ ~ ์ตœ์ข… 8๋‹จ๊ณ„๊นŒ์ง€) ํด๋ฆญ ํ›„ ์ž…๋ ฅ ๋ฐ”๋ž๋‹ˆ๋‹ค.", elem_id="description2") # ์„ค๋ช…๊ธ€ 2
208
 
209
 
210
  with gr.Tab("์ง„๋‹จ ๊ธฐ๋ณธ ์ •๋ณด ์ž…๋ ฅ"):
 
106
 
107
  def calculate_score(*answers):
108
  total_score = sum([scores[i][options[i].index(answer)] for i, answer in enumerate(answers)])
109
+ grade, definition = get_grade(total_score)
110
+ return total_score, grade, definition
111
 
112
 
113
  def get_grade(total_score):
 
123
 
124
  for grade, (low, high, definition) in grades.items():
125
  if low <= converted_score <= high:
126
+ return grade, definition
127
+ return "No Grade", ""
128
 
129
+ # Powered by arxivgpt
130
+
131
  css = """
132
  footer {
133
  visibility: hidden;
 
204
 
205
 
206
  with gr.Blocks(css=css) as demo:
207
+ gr.Markdown("# ์ฝ”๋ ˆ์ดํŒ…(KORating) ์…€ํ”„ ์ง„๋‹จ ์„œ๋น„์Šค", elem_id="title")
208
+ gr.Markdown("### ๋””์ง€ํ„ธ์ž์‚ฐ ์ธ์ฆํ‰๊ฐ€์˜ ๋ฆฌ๋” '์ฝ”๋ ˆ์ดํŒ…'(KORating) ์…€ํ”„ ์ง„๋‹จ ์„œ๋น„์Šค๋Š”, ํˆฌ์ž์ž ๋ณดํ˜ธ ๋ฐ ๊ฑด์ „ํ•œ ๊ฐ€์ƒ์ž์‚ฐ ์ƒํƒœ๊ณ„ ๊ตฌ์ถ•์„ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค.", elem_id="description1")
209
+ gr.Markdown("### ๊ธฐ๋ณธ ์ •๋ณด ์ž…๋ ฅ ํ›„ ์ด 8๋‹จ๊ณ„ TAP(1๋‹จ๊ณ„ ~ ์ตœ์ข… 8๋‹จ๊ณ„๊นŒ์ง€) ํด๋ฆญ ํ›„ ์ž…๋ ฅ ๋ฐ”๋ž๋‹ˆ๋‹ค.", elem_id="description2")
210
 
211
 
212
  with gr.Tab("์ง„๋‹จ ๊ธฐ๋ณธ ์ •๋ณด ์ž…๋ ฅ"):