Sina Media Lab commited on
Commit
c0c50e8
·
1 Parent(s): 0fdb658
Files changed (1) hide show
  1. app.py +12 -1
app.py CHANGED
@@ -46,7 +46,18 @@ def generate_pdf_report():
46
  pdf.ln(10)
47
 
48
  for i, entry in enumerate(st.session_state.questions):
 
 
 
 
 
 
 
49
  pdf.set_font("Arial", size=12)
 
 
 
 
50
  pdf.multi_cell(0, 10, f"Q{i+1}: {entry['question']}")
51
  pdf.ln(3)
52
 
@@ -172,7 +183,7 @@ if selected_category:
172
 
173
  with col2:
174
  # Add some spacing above the button by placing it inside an empty container
175
- st.markdown("<div style='margin-top: 20px;'></div>", unsafe_allow_html=True)
176
  # Show PDF report button, initially disabled until a question is answered
177
  pdf_disabled = len(st.session_state.questions) == 0
178
  if st.session_state.pdf_data:
 
46
  pdf.ln(10)
47
 
48
  for i, entry in enumerate(st.session_state.questions):
49
+ # Add Category > Module as a header
50
+ pdf.set_fill_color(0, 0, 0) # Black background
51
+ pdf.set_text_color(255, 255, 255) # White text
52
+ pdf.set_font("Arial", style='B', size=12)
53
+ pdf.cell(0, 10, f"{entry['category']} > {entry['module_title']}", ln=True, align="L", fill=True)
54
+
55
+ pdf.set_text_color(0, 0, 0) # Reset text color to black
56
  pdf.set_font("Arial", size=12)
57
+ pdf.ln(5)
58
+
59
+ # Question number and text
60
+ pdf.set_font("Arial", style='B', size=12)
61
  pdf.multi_cell(0, 10, f"Q{i+1}: {entry['question']}")
62
  pdf.ln(3)
63
 
 
183
 
184
  with col2:
185
  # Add some spacing above the button by placing it inside an empty container
186
+ st.markdown("<div style='margin-top: 25px;'></div>", unsafe_allow_html=True) # Increased margin by 5px
187
  # Show PDF report button, initially disabled until a question is answered
188
  pdf_disabled = len(st.session_state.questions) == 0
189
  if st.session_state.pdf_data: