Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -293,23 +293,8 @@ def update_similar_question_display(new_question, i, answered=False):
|
|
293 |
st.rerun()
|
294 |
with col2:
|
295 |
display_option_content(new_question['choices'][opt])
|
296 |
-
|
297 |
-
|
298 |
-
# display_math_content(new_question['question'])
|
299 |
-
# st.write("**๋ณด๊ธฐ:**")
|
300 |
-
|
301 |
-
# for opt in ['A', 'B', 'C', 'D']:
|
302 |
-
# col1, col2 = st.columns([1, 11])
|
303 |
-
# with col1:
|
304 |
-
# if not answered:
|
305 |
-
# if st.button(opt, key=f"sim_btn_{opt}_{i}"):
|
306 |
-
# st.session_state[f"similar_question_answered_{i}"] = True
|
307 |
-
# st.session_state[f"selected_answer_{i}"] = opt
|
308 |
-
# correct_answer = st.session_state.get('current_similar_question_answer')
|
309 |
-
# st.session_state[f"is_correct_{i}"] = (opt == correct_answer)
|
310 |
-
# st.rerun()
|
311 |
-
# with col2:
|
312 |
-
# display_option_content(new_question['choices'][opt])
|
313 |
def main():
|
314 |
"""๋ฉ์ธ ์ ํ๋ฆฌ์ผ์ด์
๋ก์ง"""
|
315 |
st.title("MisconcepTutor")
|
@@ -396,7 +381,6 @@ def main():
|
|
396 |
st.write("**๐ ๋ฌธ์ :**")
|
397 |
display_math_content(wrong_q['QuestionText']) # ๋ฌธ์ ๋ ๋๋ง
|
398 |
st.write("**โ
์ ๋ต:**")
|
399 |
-
#display_math_content(wrong_q[f'Answer{wrong_q["CorrectAnswer"]}Text']) # ์ ๋ต ๋ ๋๋ง
|
400 |
display_option_content(wrong_q[f'Answer{wrong_q["CorrectAnswer"]}Text'])
|
401 |
|
402 |
st.write("---")
|
@@ -421,44 +405,50 @@ def main():
|
|
421 |
|
422 |
# ๋ต๋ณ ์ํ ํ์ธ
|
423 |
answered = st.session_state.get(f"similar_question_answered_{i}", False)
|
424 |
-
update_similar_question_display(new_question, i, answered)
|
|
|
|
|
|
|
|
|
|
|
|
|
425 |
|
426 |
# ๋ณด๊ธฐ ํ์
|
427 |
-
st.write("**๋ณด๊ธฐ:**")
|
428 |
-
col1, col2 = st.columns(2)
|
429 |
|
430 |
|
431 |
# ๋ต๋ณํ์ง ์์ ๊ฒฝ์ฐ์๋ง ๋ฒํผ ํ์ฑํ
|
432 |
-
if not answered:
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
|
463 |
# ๋ต๋ณํ ๊ฒฝ์ฐ ๊ฒฐ๊ณผ ํ์
|
464 |
if answered:
|
|
|
293 |
st.rerun()
|
294 |
with col2:
|
295 |
display_option_content(new_question['choices'][opt])
|
296 |
+
|
297 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
298 |
def main():
|
299 |
"""๋ฉ์ธ ์ ํ๋ฆฌ์ผ์ด์
๋ก์ง"""
|
300 |
st.title("MisconcepTutor")
|
|
|
381 |
st.write("**๐ ๋ฌธ์ :**")
|
382 |
display_math_content(wrong_q['QuestionText']) # ๋ฌธ์ ๋ ๋๋ง
|
383 |
st.write("**โ
์ ๋ต:**")
|
|
|
384 |
display_option_content(wrong_q[f'Answer{wrong_q["CorrectAnswer"]}Text'])
|
385 |
|
386 |
st.write("---")
|
|
|
405 |
|
406 |
# ๋ต๋ณ ์ํ ํ์ธ
|
407 |
answered = st.session_state.get(f"similar_question_answered_{i}", False)
|
408 |
+
#update_similar_question_display(new_question, i, answered)
|
409 |
+
|
410 |
+
display_question(question_text,
|
411 |
+
new_question['choices']['A'],
|
412 |
+
new_question['choices']['B'],
|
413 |
+
new_question['choices']['C'],
|
414 |
+
new_question['choices']['D'])
|
415 |
|
416 |
# ๋ณด๊ธฐ ํ์
|
417 |
+
#st.write("**๋ณด๊ธฐ:**")
|
418 |
+
#col1, col2 = st.columns(2)
|
419 |
|
420 |
|
421 |
# ๋ต๋ณํ์ง ์์ ๊ฒฝ์ฐ์๋ง ๋ฒํผ ํ์ฑํ
|
422 |
+
# if not answered:
|
423 |
+
# with col1:
|
424 |
+
# for option in ['A', 'C']:
|
425 |
+
# if st.button(
|
426 |
+
# f"{option}) {LatexNodes2Text().latex_to_text(new_question['choices'][option])}",
|
427 |
+
# key=f"similar_{option}_{i}"
|
428 |
+
# ):
|
429 |
+
# st.session_state[f"similar_question_answered_{i}"] = True
|
430 |
+
# st.session_state[f"selected_answer_{i}"] = option
|
431 |
+
# correct_answer = st.session_state.get('current_similar_question_answer')
|
432 |
+
# if option == correct_answer:
|
433 |
+
# st.session_state[f"is_correct_{i}"] = True
|
434 |
+
# else:
|
435 |
+
# st.session_state[f"is_correct_{i}"] = False
|
436 |
+
# st.rerun()
|
437 |
|
438 |
+
# with col2:
|
439 |
+
# for option in ['B', 'D']:
|
440 |
+
# if st.button(
|
441 |
+
# f"{option}) {LatexNodes2Text().latex_to_text(new_question['choices'][option])}",
|
442 |
+
# key=f"similar_{option}_{i}"
|
443 |
+
# ):
|
444 |
+
# st.session_state[f"similar_question_answered_{i}"] = True
|
445 |
+
# st.session_state[f"selected_answer_{i}"] = option
|
446 |
+
# correct_answer = st.session_state.get('current_similar_question_answer')
|
447 |
+
# if option == correct_answer:
|
448 |
+
# st.session_state[f"is_correct_{i}"] = True
|
449 |
+
# else:
|
450 |
+
# st.session_state[f"is_correct_{i}"] = False
|
451 |
+
# st.rerun()
|
452 |
|
453 |
# ๋ต๋ณํ ๊ฒฝ์ฐ ๊ฒฐ๊ณผ ํ์
|
454 |
if answered:
|