Sina Media Lab
commited on
Commit
Β·
f0f573f
1
Parent(s):
a58f65d
Updates
Browse files
app.py
CHANGED
@@ -148,7 +148,7 @@ if selected_category:
|
|
148 |
selected_module_data = module_data
|
149 |
break
|
150 |
|
151 |
-
# Display black background title with PDF report
|
152 |
st.markdown(
|
153 |
f"""
|
154 |
<div style="background-color: #333; padding: 10px; border-radius: 5px; margin-top: 20px;">
|
@@ -159,12 +159,9 @@ if selected_category:
|
|
159 |
)
|
160 |
|
161 |
if len(st.session_state.questions) > 0:
|
162 |
-
st.
|
163 |
-
|
164 |
-
|
165 |
-
""",
|
166 |
-
unsafe_allow_html=True
|
167 |
-
)
|
168 |
|
169 |
if selected_module != st.session_state.current_module:
|
170 |
st.session_state.current_module = selected_module
|
|
|
148 |
selected_module_data = module_data
|
149 |
break
|
150 |
|
151 |
+
# Display black background title with PDF report button, but only show the button when at least one question is answered
|
152 |
st.markdown(
|
153 |
f"""
|
154 |
<div style="background-color: #333; padding: 10px; border-radius: 5px; margin-top: 20px;">
|
|
|
159 |
)
|
160 |
|
161 |
if len(st.session_state.questions) > 0:
|
162 |
+
if st.button("π Download PDF Report"):
|
163 |
+
pdf_data = generate_pdf_report()
|
164 |
+
st.download_button(label="Click to download", data=pdf_data, file_name="quiz_report.pdf", mime="application/pdf")
|
|
|
|
|
|
|
165 |
|
166 |
if selected_module != st.session_state.current_module:
|
167 |
st.session_state.current_module = selected_module
|