Sina Media Lab commited on
Commit
14697cf
·
1 Parent(s): c0c50e8
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -41,8 +41,8 @@ def generate_pdf_report():
41
  pdf.cell(0, 10, txt="Magic Math Quiz", ln=True, align="C")
42
  pdf.ln(5)
43
 
44
- # Load the image from the local directory, scaled down and centered
45
- pdf.image("assets/gt.png", x=(210 - 25) / 2, w=25, link="https://ghassem.com") # Centered horizontally and scaled down
46
  pdf.ln(10)
47
 
48
  for i, entry in enumerate(st.session_state.questions):
@@ -153,7 +153,7 @@ st.sidebar.markdown(
153
  <div style='background-color: white; padding: 10px; border-radius: 10px; text-align: center; color: black;'>
154
  <h1 style='margin: 0;'>🪄 Magic Math Quiz<sup>Beta</sup>!</h1>
155
  <a href="https://ghassem.com" target="_blank">
156
- <img src="assets/gt.png" alt="Logo" style="width:50%; margin-top: 10px;">
157
  </a>
158
  </div>
159
  """, unsafe_allow_html=True)
@@ -212,14 +212,12 @@ if selected_category:
212
 
213
  current_question = st.session_state.current_question
214
 
215
- # Display the current question with larger font
216
- st.markdown(f"<span style='font-size: 18px;'><b>Q{st.session_state.current_index + 1}: {current_question['question']}</b></span>", unsafe_allow_html=True)
217
-
218
- # Create the form for the question
219
  with st.form(key=f'question_form_{st.session_state.current_index}'):
220
  options = ['a', 'b', 'c', 'd']
 
221
  selected_answer = st.radio(
222
- "Choose an answer:",
223
  options=[f"{options[i]}. {opt}" for i, opt in enumerate(current_question['options'])],
224
  key=f"question_{st.session_state.current_index}_options",
225
  index=None,
 
41
  pdf.cell(0, 10, txt="Magic Math Quiz", ln=True, align="C")
42
  pdf.ln(5)
43
 
44
+ # Load the image from the URL, scaled down and centered
45
+ pdf.image("https://huggingface.co/spaces/tofighi/math/resolve/main/assets/gt.png", x=(210 - 25) / 2, w=25, link="https://ghassem.com") # Centered horizontally and scaled down
46
  pdf.ln(10)
47
 
48
  for i, entry in enumerate(st.session_state.questions):
 
153
  <div style='background-color: white; padding: 10px; border-radius: 10px; text-align: center; color: black;'>
154
  <h1 style='margin: 0;'>🪄 Magic Math Quiz<sup>Beta</sup>!</h1>
155
  <a href="https://ghassem.com" target="_blank">
156
+ <img src="https://huggingface.co/spaces/tofighi/math/resolve/main/assets/gt.png" alt="Logo" style="width:50%; margin-top: 10px;">
157
  </a>
158
  </div>
159
  """, unsafe_allow_html=True)
 
212
 
213
  current_question = st.session_state.current_question
214
 
215
+ # Display the current question inside the options box
 
 
 
216
  with st.form(key=f'question_form_{st.session_state.current_index}'):
217
  options = ['a', 'b', 'c', 'd']
218
+ st.markdown(f"<b>Q{st.session_state.current_index + 1}: {current_question['question']}</b>", unsafe_allow_html=True)
219
  selected_answer = st.radio(
220
+ "", # Empty label to put the question inside the options box
221
  options=[f"{options[i]}. {opt}" for i, opt in enumerate(current_question['options'])],
222
  key=f"question_{st.session_state.current_index}_options",
223
  index=None,