Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -165,36 +165,4 @@ if st.session_state.main_points:
|
|
165 |
mime="text/plain"
|
166 |
)
|
167 |
|
168 |
-
|
169 |
-
if st.session_state.flashcards:
|
170 |
-
st.markdown("### Flashcards")
|
171 |
-
flashcards = st.session_state.flashcards.split("\n\n") # Assuming flashcards are separated by double newlines
|
172 |
-
st.markdown('<div class="flashcard-container">', unsafe_allow_html=True)
|
173 |
-
for card in flashcards:
|
174 |
-
try:
|
175 |
-
# Check if card contains both question and answer
|
176 |
-
if '\n' in card:
|
177 |
-
question, answer = card.split('\n', 1)
|
178 |
-
st.markdown(f"""
|
179 |
-
<div class="flashcard">
|
180 |
-
<div class="flashcard-inner">
|
181 |
-
<div class="flashcard-front">
|
182 |
-
<p>{question.strip()}</p>
|
183 |
-
</div>
|
184 |
-
<div class="flashcard-back">
|
185 |
-
<p>{answer.strip()}</p>
|
186 |
-
</div>
|
187 |
-
</div>
|
188 |
-
</div>
|
189 |
-
""", unsafe_allow_html=True)
|
190 |
-
else:
|
191 |
-
st.error("Invalid flashcard format. Each flashcard should be in 'question\\nanswer' format.")
|
192 |
-
except Exception as e:
|
193 |
-
st.error(f"Error processing flashcard: {e}")
|
194 |
-
st.markdown('</div>', unsafe_allow_html=True)
|
195 |
-
st.download_button(
|
196 |
-
label="Download Flashcards",
|
197 |
-
data=st.session_state.flashcards,
|
198 |
-
file_name="flashcards.txt",
|
199 |
-
mime="text/plain"
|
200 |
-
)
|
|
|
165 |
mime="text/plain"
|
166 |
)
|
167 |
|
168 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|