Jintonic92 commited on
Commit
30353ba
ยท
verified ยท
1 Parent(s): 2543002

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -4
app.py CHANGED
@@ -255,17 +255,31 @@ def add_custom_css():
255
 
256
 
257
  # 2210
 
 
 
 
 
 
 
 
 
 
 
 
258
  def display_question(question, answers):
259
- """Display a math problem and its options"""
260
  st.markdown('<div class="problem-header">Problem:</div>', unsafe_allow_html=True)
261
- display_math_content(question) # ๋ฌธ์ œ ๋ Œ๋”๋ง
 
262
  col1, col2 = st.columns(2)
263
  for i, (col, opt) in enumerate([(col1, 'A'), (col1, 'C'), (col2, 'B'), (col2, 'D')]):
264
  with col:
265
- if st.button(opt, key=f"btn_{opt}"): # ๊ด„ํ˜ธ ์ œ๊ฑฐ
 
266
  handle_answer(opt, st.session_state.questions.iloc[st.session_state.current_question_index])
267
  st.rerun()
268
- display_math_content(answers[opt]) # ๋ณด๊ธฐ LaTeX ๋ Œ๋”๋ง
269
 
270
  def main():
271
  """๋ฉ”์ธ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋กœ์ง"""
 
255
 
256
 
257
  # 2210
258
+ # def display_question(question, answers):
259
+ # """Display a math problem and its options"""
260
+ # st.markdown('<div class="problem-header">Problem:</div>', unsafe_allow_html=True)
261
+ # display_math_content(question) # ๋ฌธ์ œ ๋ Œ๋”๋ง
262
+ # col1, col2 = st.columns(2)
263
+ # for i, (col, opt) in enumerate([(col1, 'A'), (col1, 'C'), (col2, 'B'), (col2, 'D')]):
264
+ # with col:
265
+ # if st.button(opt, key=f"btn_{opt}"): # ๊ด„ํ˜ธ ์ œ๊ฑฐ
266
+ # handle_answer(opt, st.session_state.questions.iloc[st.session_state.current_question_index])
267
+ # st.rerun()
268
+ # display_math_content(answers[opt]) # ๋ณด๊ธฐ LaTeX ๋ Œ๋”๋ง
269
+
270
  def display_question(question, answers):
271
+ """Display a math problem and its options with LaTeX formatting"""
272
  st.markdown('<div class="problem-header">Problem:</div>', unsafe_allow_html=True)
273
+ display_math_content(question)
274
+
275
  col1, col2 = st.columns(2)
276
  for i, (col, opt) in enumerate([(col1, 'A'), (col1, 'C'), (col2, 'B'), (col2, 'D')]):
277
  with col:
278
+ answer_text = answers[opt]
279
+ if st.button(answer_text, key=f"btn_{opt}"):
280
  handle_answer(opt, st.session_state.questions.iloc[st.session_state.current_question_index])
281
  st.rerun()
282
+
283
 
284
  def main():
285
  """๋ฉ”์ธ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋กœ์ง"""