Jintonic92 commited on
Commit
97ccdbd
ยท
verified ยท
1 Parent(s): fec1647

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -80
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
  # ์œ ์‚ฌ ๋ฌธ์ œ ์ƒ์„ฑ ์ƒํƒœ๋ฅผ ์„ธ์…˜์— ์ €์žฅ