Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,7 +5,6 @@ from src.SecondModule.module2 import SimilarQuestionGenerator
|
|
| 5 |
from src.ThirdModule.module3 import AnswerVerifier
|
| 6 |
import logging
|
| 7 |
from typing import Optional, Tuple
|
| 8 |
-
#from latex_formatter import LatexFormatter # LaTeX 포맷터 import
|
| 9 |
from pylatexenc.latex2text import LatexNodes2Text
|
| 10 |
import re
|
| 11 |
|
|
@@ -339,15 +338,20 @@ def update_similar_question_display(new_question, i, answered=False):
|
|
| 339 |
"""Display similar question and its options"""
|
| 340 |
display_math_content(new_question['question'])
|
| 341 |
|
| 342 |
-
|
| 343 |
-
for
|
| 344 |
-
with
|
| 345 |
-
st.
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 351 |
|
| 352 |
def main():
|
| 353 |
"""메인 애플리케이션 로직"""
|
|
|
|
| 5 |
from src.ThirdModule.module3 import AnswerVerifier
|
| 6 |
import logging
|
| 7 |
from typing import Optional, Tuple
|
|
|
|
| 8 |
from pylatexenc.latex2text import LatexNodes2Text
|
| 9 |
import re
|
| 10 |
|
|
|
|
| 338 |
"""Display similar question and its options"""
|
| 339 |
display_math_content(new_question['question'])
|
| 340 |
|
| 341 |
+
# Display options
|
| 342 |
+
for opt in ['A', 'B', 'C', 'D']:
|
| 343 |
+
with st.container():
|
| 344 |
+
col1, col2 = st.columns([1, 11])
|
| 345 |
+
with col1:
|
| 346 |
+
if st.button(f"{opt}.", key=f"sim_btn_{opt}_{i}", help="Click to select"):
|
| 347 |
+
if not answered:
|
| 348 |
+
st.session_state[f"similar_question_answered_{i}"] = True
|
| 349 |
+
st.session_state[f"selected_answer_{i}"] = opt
|
| 350 |
+
correct_answer = st.session_state.get('current_similar_question_answer')
|
| 351 |
+
st.session_state[f"is_correct_{i}"] = (opt == correct_answer)
|
| 352 |
+
st.rerun()
|
| 353 |
+
with col2:
|
| 354 |
+
display_option_content(new_question['choices'][opt])
|
| 355 |
|
| 356 |
def main():
|
| 357 |
"""메인 애플리케이션 로직"""
|