Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -275,6 +275,25 @@ def display_option_content(option_text):
|
|
| 275 |
st.markdown(f'<div class="math-container">{formatted_content}</div>', unsafe_allow_html=True)
|
| 276 |
|
| 277 |
# ์ถ๊ฐ
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 278 |
def update_similar_question_display(new_question, i, answered=False):
|
| 279 |
"""Display similar question and its options"""
|
| 280 |
display_math_content(new_question['question'])
|
|
@@ -286,15 +305,16 @@ def update_similar_question_display(new_question, i, answered=False):
|
|
| 286 |
with col1:
|
| 287 |
if st.button(f"{opt}.", key=f"sim_btn_{opt}_{i}", help="Click to select"):
|
| 288 |
if not answered:
|
|
|
|
| 289 |
st.session_state[f"similar_question_answered_{i}"] = True
|
| 290 |
st.session_state[f"selected_answer_{i}"] = opt
|
| 291 |
correct_answer = st.session_state.get('current_similar_question_answer')
|
|
|
|
| 292 |
st.session_state[f"is_correct_{i}"] = (opt == correct_answer)
|
| 293 |
st.rerun()
|
| 294 |
with col2:
|
| 295 |
display_option_content(new_question['choices'][opt])
|
| 296 |
|
| 297 |
-
|
| 298 |
def main():
|
| 299 |
"""๋ฉ์ธ ์ ํ๋ฆฌ์ผ์ด์
๋ก์ง"""
|
| 300 |
st.title("MisconcepTutor")
|
|
|
|
| 275 |
st.markdown(f'<div class="math-container">{formatted_content}</div>', unsafe_allow_html=True)
|
| 276 |
|
| 277 |
# ์ถ๊ฐ
|
| 278 |
+
# def update_similar_question_display(new_question, i, answered=False):
|
| 279 |
+
# """Display similar question and its options"""
|
| 280 |
+
# display_math_content(new_question['question'])
|
| 281 |
+
|
| 282 |
+
# # Display options
|
| 283 |
+
# for opt in ['A', 'B', 'C', 'D']:
|
| 284 |
+
# with st.container():
|
| 285 |
+
# col1, col2 = st.columns([1, 11])
|
| 286 |
+
# with col1:
|
| 287 |
+
# if st.button(f"{opt}.", key=f"sim_btn_{opt}_{i}", help="Click to select"):
|
| 288 |
+
# if not answered:
|
| 289 |
+
# st.session_state[f"similar_question_answered_{i}"] = True
|
| 290 |
+
# st.session_state[f"selected_answer_{i}"] = opt
|
| 291 |
+
# correct_answer = st.session_state.get('current_similar_question_answer')
|
| 292 |
+
# st.session_state[f"is_correct_{i}"] = (opt == correct_answer)
|
| 293 |
+
# st.rerun()
|
| 294 |
+
# with col2:
|
| 295 |
+
# display_option_content(new_question['choices'][opt])
|
| 296 |
+
|
| 297 |
def update_similar_question_display(new_question, i, answered=False):
|
| 298 |
"""Display similar question and its options"""
|
| 299 |
display_math_content(new_question['question'])
|
|
|
|
| 305 |
with col1:
|
| 306 |
if st.button(f"{opt}.", key=f"sim_btn_{opt}_{i}", help="Click to select"):
|
| 307 |
if not answered:
|
| 308 |
+
# ์ ํํ ์ต์
(opt)์ st.session_state์ ์ ์ฅ
|
| 309 |
st.session_state[f"similar_question_answered_{i}"] = True
|
| 310 |
st.session_state[f"selected_answer_{i}"] = opt
|
| 311 |
correct_answer = st.session_state.get('current_similar_question_answer')
|
| 312 |
+
# ์ ๋ต ์ฌ๋ถ๋ฅผ ํ์ธ
|
| 313 |
st.session_state[f"is_correct_{i}"] = (opt == correct_answer)
|
| 314 |
st.rerun()
|
| 315 |
with col2:
|
| 316 |
display_option_content(new_question['choices'][opt])
|
| 317 |
|
|
|
|
| 318 |
def main():
|
| 319 |
"""๋ฉ์ธ ์ ํ๋ฆฌ์ผ์ด์
๋ก์ง"""
|
| 320 |
st.title("MisconcepTutor")
|