Sina Media Lab
commited on
Commit
Β·
e6dc747
1
Parent(s):
6789e51
Updates
Browse files
app.py
CHANGED
@@ -135,7 +135,7 @@ st.sidebar.markdown(
|
|
135 |
<div style='background-color: white; padding: 10px; border-radius: 10px; text-align: center; color: black;'>
|
136 |
<h1 style='margin: 0;'>Magic Math Quiz!</h1>
|
137 |
<a href="https://ghassem.com" target="_blank">
|
138 |
-
<img src="https://i.imgur.com/dF3KWgY.png" alt="Logo" style="width:
|
139 |
</a>
|
140 |
<h6 style='margin: 0; font-size: 10px;'><a href="https://ghassem.com" target="_blank" style="color: black; text-decoration: none;'>By Ghassem Tofighi</a></h6>
|
141 |
</div>
|
@@ -155,7 +155,7 @@ if selected_category:
|
|
155 |
# Display black background title with PDF report icon in front
|
156 |
st.markdown(
|
157 |
f"""
|
158 |
-
<div style="background-color: #333; padding: 10px; border-radius: 5px; margin-top:
|
159 |
<span style='font-size: 18px; color: white;'>{selected_category} > {selected_module_data['title']}</span>
|
160 |
<a href='#' download='quiz_report.pdf' style='font-size: 18px; margin-left: 10px; color: white;' onclick='document.getElementById("pdf-link").click();'>π Download PDF Report</a>
|
161 |
</div>
|
@@ -237,3 +237,6 @@ if submit_button:
|
|
237 |
# Generate a new question after submission
|
238 |
st.session_state.current_question = generate_new_question(selected_category, selected_module, selected_module_data)
|
239 |
st.session_state.start_time = time.time() # Reset the timer for the new question
|
|
|
|
|
|
|
|
135 |
<div style='background-color: white; padding: 10px; border-radius: 10px; text-align: center; color: black;'>
|
136 |
<h1 style='margin: 0;'>Magic Math Quiz!</h1>
|
137 |
<a href="https://ghassem.com" target="_blank">
|
138 |
+
<img src="https://i.imgur.com/dF3KWgY.png" alt="Logo" style="width:40%; border-radius: 5px;">
|
139 |
</a>
|
140 |
<h6 style='margin: 0; font-size: 10px;'><a href="https://ghassem.com" target="_blank" style="color: black; text-decoration: none;'>By Ghassem Tofighi</a></h6>
|
141 |
</div>
|
|
|
155 |
# Display black background title with PDF report icon in front
|
156 |
st.markdown(
|
157 |
f"""
|
158 |
+
<div style="background-color: #333; padding: 10px; border-radius: 5px; margin-top: 20px;">
|
159 |
<span style='font-size: 18px; color: white;'>{selected_category} > {selected_module_data['title']}</span>
|
160 |
<a href='#' download='quiz_report.pdf' style='font-size: 18px; margin-left: 10px; color: white;' onclick='document.getElementById("pdf-link").click();'>π Download PDF Report</a>
|
161 |
</div>
|
|
|
237 |
# Generate a new question after submission
|
238 |
st.session_state.current_question = generate_new_question(selected_category, selected_module, selected_module_data)
|
239 |
st.session_state.start_time = time.time() # Reset the timer for the new question
|
240 |
+
|
241 |
+
# Generate the PDF report data after each submission
|
242 |
+
st.session_state.pdf_data = generate_pdf_report()
|