jonghhhh commited on
Commit
85eda91
Β·
verified Β·
1 Parent(s): baef142

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -41,7 +41,7 @@ if user_type == "μ„€λ¬Έ μ„€μ •":
41
 
42
  # 학생 응닡 νŽ˜μ΄μ§€
43
  elif user_type == "학생 응닡":
44
- st.title("ν•™μƒμš© μ„€λ¬Έ 응닡")
45
  if os.path.exists(survey_file_path):
46
  df = pd.read_csv(survey_file_path)
47
  question = df['question'][0]
@@ -80,7 +80,7 @@ elif user_type == "학생 응닡":
80
  else:
81
  st.warning("섀문이 아직 μ„€μ •λ˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€. κ°•μ‚¬μ—κ²Œ λ¬Έμ˜ν•˜μ„Έμš”.")
82
 
83
- # κ²°κ³Ό 확인 νŽ˜μ΄μ§€ (κ΅μ‚¬μš©)
84
  elif user_type == "κ²°κ³Ό 확인":
85
  st.title("μ„€λ¬Έ κ²°κ³Ό 확인")
86
  if os.path.exists(responses_file_path):
@@ -90,12 +90,11 @@ elif user_type == "κ²°κ³Ό 확인":
90
  survey_df = pd.read_csv(survey_file_path)
91
  use_options = survey_df['use_options'][0]
92
  if use_options:
 
93
  # 객관식 μ‘λ‹΅λ§Œ ν•„ν„°λ§ν•˜μ—¬ λ§‰λŒ€ κ·Έλž˜ν”„ 생성
94
  objective_responses = df[df['μœ ν˜•'] == '객관식']
95
- if not objective_responses.empty:
96
- st.bar_chart(objective_responses['응닡'].value_counts())
97
- else:
98
- st.info("아직 객관식 응닡이 μ—†μŠ΅λ‹ˆλ‹€.")
99
 
100
  # 주관식 응닡 ν‘œμ‹œ
101
  subjective_responses = df[df['μœ ν˜•'] == '주관식']
@@ -110,3 +109,4 @@ elif user_type == "κ²°κ³Ό 확인":
110
  st.table(df)
111
  else:
112
  st.warning("아직 제좜된 닡변이 μ—†μŠ΅λ‹ˆλ‹€.")
 
 
41
 
42
  # 학생 응닡 νŽ˜μ΄μ§€
43
  elif user_type == "학생 응닡":
44
+ st.title("μ„€λ¬Έ 응닡")
45
  if os.path.exists(survey_file_path):
46
  df = pd.read_csv(survey_file_path)
47
  question = df['question'][0]
 
80
  else:
81
  st.warning("섀문이 아직 μ„€μ •λ˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€. κ°•μ‚¬μ—κ²Œ λ¬Έμ˜ν•˜μ„Έμš”.")
82
 
83
+ # κ²°κ³Ό 확인 νŽ˜μ΄μ§€ (κ°•μ‚¬μš©)
84
  elif user_type == "κ²°κ³Ό 확인":
85
  st.title("μ„€λ¬Έ κ²°κ³Ό 확인")
86
  if os.path.exists(responses_file_path):
 
90
  survey_df = pd.read_csv(survey_file_path)
91
  use_options = survey_df['use_options'][0]
92
  if use_options:
93
+ options = eval(survey_df['options'][0])
94
  # 객관식 μ‘λ‹΅λ§Œ ν•„ν„°λ§ν•˜μ—¬ λ§‰λŒ€ κ·Έλž˜ν”„ 생성
95
  objective_responses = df[df['μœ ν˜•'] == '객관식']
96
+ response_counts = objective_responses['응닡'].value_counts().reindex(options, fill_value=0)
97
+ st.bar_chart(response_counts)
 
 
98
 
99
  # 주관식 응닡 ν‘œμ‹œ
100
  subjective_responses = df[df['μœ ν˜•'] == '주관식']
 
109
  st.table(df)
110
  else:
111
  st.warning("아직 제좜된 닡변이 μ—†μŠ΅λ‹ˆλ‹€.")
112
+