Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -239,86 +239,6 @@ def main():
|
|
| 239 |
else:
|
| 240 |
st.info("Misconception ์ ๋ณด๊ฐ ์์ต๋๋ค.")
|
| 241 |
|
| 242 |
-
# # ์ ์ฌ ๋ฌธ์ ์์ฑ ๋ฒํผ
|
| 243 |
-
# if st.button(f"๐ ์ ์ฌ ๋ฌธ์ ํ๊ธฐ #{i + 1}", key=f"retry_{i}"):
|
| 244 |
-
# with st.spinner("์ ์ฌ ๋ฌธ์ ๋ฅผ ์์ฑํ๊ณ ์์ต๋๋ค..."):
|
| 245 |
-
# logger.info(f"Generating similar question for misconception_id: {misconception_id}")
|
| 246 |
-
# new_question = generate_similar_question(wrong_q, misconception_id, generator)
|
| 247 |
-
# if new_question:
|
| 248 |
-
# st.write("### ๐ฏ ์ ์ฌ ๋ฌธ์ ")
|
| 249 |
-
# st.write(new_question['question'])
|
| 250 |
-
# st.write("**๋ณด๊ธฐ:**")
|
| 251 |
-
# for choice, text in new_question['choices'].items():
|
| 252 |
-
# st.write(f"{choice}) {text}")
|
| 253 |
-
# st.write("**โ
์ ๋ต:**", new_question['correct'])
|
| 254 |
-
# st.write("**๐ ํด์ค:**", new_question['explanation'])
|
| 255 |
-
# else:
|
| 256 |
-
# st.error("์ ์ฌ ๋ฌธ์ ๋ฅผ ์์ฑํ ์ ์์ต๋๋ค.")
|
| 257 |
-
|
| 258 |
-
# # ์ ์ฌ ๋ฌธ์ ์์ฑ ๋ฒํผ
|
| 259 |
-
# if st.button(f"๐ ์ ์ฌ ๋ฌธ์ ํ๊ธฐ #{i + 1}", key=f"retry_{i}"):
|
| 260 |
-
# with st.spinner("์ ์ฌ ๋ฌธ์ ๋ฅผ ์์ฑํ๊ณ ์์ต๋๋ค..."):
|
| 261 |
-
# logger.info(f"Generating similar question for misconception_id: {misconception_id}")
|
| 262 |
-
# new_question = generate_similar_question(wrong_q, misconception_id, generator)
|
| 263 |
-
# if new_question:
|
| 264 |
-
# st.write("### ๐ฏ ์ ์ฌ ๋ฌธ์ ")
|
| 265 |
-
# st.write(new_question['question'])
|
| 266 |
-
|
| 267 |
-
# # ์ ๋ต์ ์ธ์
์คํ
์ดํธ์ ์ ์ฅ
|
| 268 |
-
# if f"similar_question_answered_{i}" not in st.session_state:
|
| 269 |
-
# st.session_state[f"similar_question_answered_{i}"] = False
|
| 270 |
-
# if f"similar_question_correct_{i}" not in st.session_state:
|
| 271 |
-
# st.session_state[f"similar_question_correct_{i}"] = new_question['correct']
|
| 272 |
-
|
| 273 |
-
# # ์์ง ๋ต๋ณํ์ง ์์ ๊ฒฝ์ฐ์๋ง ๋ณด๊ธฐ ๋ฒํผ ํ์
|
| 274 |
-
# if not st.session_state[f"similar_question_answered_{i}"]:
|
| 275 |
-
# st.write("**๋ณด๊ธฐ:**")
|
| 276 |
-
# col1, col2 = st.columns(2)
|
| 277 |
-
# with col1:
|
| 278 |
-
# if st.button(f"A) {new_question['choices']['A']}", key=f"similar_A_{i}"):
|
| 279 |
-
# st.session_state[f"similar_question_answered_{i}"] = True
|
| 280 |
-
# if 'A' == new_question['correct']:
|
| 281 |
-
# st.success("โ
์ ๋ต์
๋๋ค!")
|
| 282 |
-
# else:
|
| 283 |
-
# st.error("โ ํ๋ ธ์ต๋๋ค.")
|
| 284 |
-
# st.rerun()
|
| 285 |
-
|
| 286 |
-
# if st.button(f"C) {new_question['choices']['C']}", key=f"similar_C_{i}"):
|
| 287 |
-
# st.session_state[f"similar_question_answered_{i}"] = True
|
| 288 |
-
# if 'C' == new_question['correct']:
|
| 289 |
-
# st.success("โ
์ ๋ต์
๋๋ค!")
|
| 290 |
-
# else:
|
| 291 |
-
# st.error("โ ํ๋ ธ์ต๋๋ค.")
|
| 292 |
-
# st.rerun()
|
| 293 |
-
|
| 294 |
-
# with col2:
|
| 295 |
-
# if st.button(f"B) {new_question['choices']['B']}", key=f"similar_B_{i}"):
|
| 296 |
-
# st.session_state[f"similar_question_answered_{i}"] = True
|
| 297 |
-
# if 'B' == new_question['correct']:
|
| 298 |
-
# st.success("โ
์ ๋ต์
๋๋ค!")
|
| 299 |
-
# else:
|
| 300 |
-
# st.error("โ ํ๋ ธ์ต๋๋ค.")
|
| 301 |
-
# st.rerun()
|
| 302 |
-
|
| 303 |
-
# if st.button(f"D) {new_question['choices']['D']}", key=f"similar_D_{i}"):
|
| 304 |
-
# st.session_state[f"similar_question_answered_{i}"] = True
|
| 305 |
-
# if 'D' == new_question['correct']:
|
| 306 |
-
# st.success("โ
์ ๋ต์
๋๋ค!")
|
| 307 |
-
# else:
|
| 308 |
-
# st.error("โ ํ๋ ธ์ต๋๋ค.")
|
| 309 |
-
# st.rerun()
|
| 310 |
-
|
| 311 |
-
# # ๋ต๋ณํ ๊ฒฝ์ฐ ๊ฒฐ๊ณผ ๋ฐ ํด์ค ํ์
|
| 312 |
-
# if st.session_state[f"similar_question_answered_{i}"]:
|
| 313 |
-
# st.write("---")
|
| 314 |
-
# st.write("**๐ ํด์ค:**", new_question['explanation'])
|
| 315 |
-
# # ๋ค์ ํ๊ธฐ ๋ฒํผ
|
| 316 |
-
# if st.button("๐ ๋ค์ ํ๊ธฐ", key=f"reset_{i}"):
|
| 317 |
-
# st.session_state[f"similar_question_answered_{i}"] = False
|
| 318 |
-
# st.rerun()
|
| 319 |
-
# else:
|
| 320 |
-
# st.error("์ ์ฌ ๋ฌธ์ ๋ฅผ ์์ฑํ ์ ์์ต๋๋ค.")
|
| 321 |
-
|
| 322 |
# ํ๋ฆฐ ๋ฌธ์ ๋ถ์ ๋ถ๋ถ์์
|
| 323 |
if st.button(f"๐ ์ ์ฌ ๋ฌธ์ ํ๊ธฐ #{i + 1}", key=f"retry_{i}"):
|
| 324 |
# ์ ์ฌ ๋ฌธ์ ์์ฑ ์ํ๋ฅผ ์ธ์
์ ์ ์ฅ
|
|
|
|
| 239 |
else:
|
| 240 |
st.info("Misconception ์ ๋ณด๊ฐ ์์ต๋๋ค.")
|
| 241 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 242 |
# ํ๋ฆฐ ๋ฌธ์ ๋ถ์ ๋ถ๋ถ์์
|
| 243 |
if st.button(f"๐ ์ ์ฌ ๋ฌธ์ ํ๊ธฐ #{i + 1}", key=f"retry_{i}"):
|
| 244 |
# ์ ์ฌ ๋ฌธ์ ์์ฑ ์ํ๋ฅผ ์ธ์
์ ์ ์ฅ
|