Sina Media Lab commited on
Commit
d4c89e6
Β·
1 Parent(s): 1596a24
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -41,6 +41,8 @@ def generate_pdf_report():
41
  pdf.cell(0, 10, txt="Magic Math Quiz", ln=True, align="C")
42
  pdf.set_font("Arial", size=10)
43
  pdf.cell(0, 10, txt="by Ghassem Tofighi", ln=True, align="C", link="https://ghassem.com")
 
 
44
  pdf.ln(10)
45
 
46
  for i, entry in enumerate(st.session_state.questions):
@@ -179,12 +181,13 @@ if selected_category:
179
  # Show PDF report button, initially disabled until a question is answered
180
  pdf_disabled = len(st.session_state.questions) == 0
181
  st.download_button(
182
- label="πŸ“„ Download PDF Report",
183
  data=st.session_state.pdf_data if not pdf_disabled else b'',
184
  file_name="quiz_report.pdf",
185
  mime="application/pdf",
186
  disabled=pdf_disabled,
187
- key="pdf_download_button"
 
188
  )
189
 
190
  if selected_module != st.session_state.current_module:
@@ -266,10 +269,11 @@ if submit_button:
266
 
267
  # Refresh the PDF button state
268
  st.download_button(
269
- label="πŸ“„ Download PDF Report",
270
  data=st.session_state.pdf_data,
271
  file_name="quiz_report.pdf",
272
  mime="application/pdf",
273
  disabled=False,
274
- key="pdf_download_button_updated"
 
275
  )
 
41
  pdf.cell(0, 10, txt="Magic Math Quiz", ln=True, align="C")
42
  pdf.set_font("Arial", size=10)
43
  pdf.cell(0, 10, txt="by Ghassem Tofighi", ln=True, align="C", link="https://ghassem.com")
44
+ pdf.ln(5)
45
+ pdf.image("https://i.imgur.com/dF3KWgY.png", x=80, w=50, link="https://ghassem.com") # Adjust the size and position as needed
46
  pdf.ln(10)
47
 
48
  for i, entry in enumerate(st.session_state.questions):
 
181
  # Show PDF report button, initially disabled until a question is answered
182
  pdf_disabled = len(st.session_state.questions) == 0
183
  st.download_button(
184
+ label="Quiz Report",
185
  data=st.session_state.pdf_data if not pdf_disabled else b'',
186
  file_name="quiz_report.pdf",
187
  mime="application/pdf",
188
  disabled=pdf_disabled,
189
+ key="pdf_download_button",
190
+ style="margin-top: 20px;"
191
  )
192
 
193
  if selected_module != st.session_state.current_module:
 
269
 
270
  # Refresh the PDF button state
271
  st.download_button(
272
+ label="Quiz Report",
273
  data=st.session_state.pdf_data,
274
  file_name="quiz_report.pdf",
275
  mime="application/pdf",
276
  disabled=False,
277
+ key="pdf_download_button_updated",
278
+ style="margin-top: 20px;"
279
  )