Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -494,10 +494,12 @@ with gr.Blocks(title="UNEB Exam Prep - Primary 6 & 7", theme=gr.themes.Soft(), c
|
|
| 494 |
# Prefer PDF export; fall back to plain text if PDF library missing
|
| 495 |
pdf_path = download_questions_pdf(session.current_questions, session.current_topic, session.current_grade)
|
| 496 |
if pdf_path:
|
| 497 |
-
|
|
|
|
| 498 |
# Fallback to text
|
| 499 |
filepath = download_questions_file(session.current_questions, session.current_topic, session.current_grade)
|
| 500 |
-
|
|
|
|
| 501 |
except Exception as e:
|
| 502 |
return None, f"β Error: {str(e)}"
|
| 503 |
|
|
@@ -661,7 +663,8 @@ with gr.Blocks(title="UNEB Exam Prep - Primary 6 & 7", theme=gr.themes.Soft(), c
|
|
| 661 |
return None, "β οΈ Get AI correction first!"
|
| 662 |
try:
|
| 663 |
filepath = download_feedback_file(session.last_feedback, session.current_topic, session.current_grade)
|
| 664 |
-
|
|
|
|
| 665 |
except Exception as e:
|
| 666 |
return None, f"β Error: {str(e)}"
|
| 667 |
|
|
|
|
| 494 |
# Prefer PDF export; fall back to plain text if PDF library missing
|
| 495 |
pdf_path = download_questions_pdf(session.current_questions, session.current_topic, session.current_grade)
|
| 496 |
if pdf_path:
|
| 497 |
+
abs_path = os.path.abspath(pdf_path)
|
| 498 |
+
return abs_path, f"β
Click the download button above to save: {os.path.basename(pdf_path)}"
|
| 499 |
# Fallback to text
|
| 500 |
filepath = download_questions_file(session.current_questions, session.current_topic, session.current_grade)
|
| 501 |
+
abs_path = os.path.abspath(filepath)
|
| 502 |
+
return abs_path, f"β
Click the download button above to save: {os.path.basename(filepath)}"
|
| 503 |
except Exception as e:
|
| 504 |
return None, f"β Error: {str(e)}"
|
| 505 |
|
|
|
|
| 663 |
return None, "β οΈ Get AI correction first!"
|
| 664 |
try:
|
| 665 |
filepath = download_feedback_file(session.last_feedback, session.current_topic, session.current_grade)
|
| 666 |
+
abs_path = os.path.abspath(filepath)
|
| 667 |
+
return abs_path, f"β
Click the download button above to save: {os.path.basename(filepath)}"
|
| 668 |
except Exception as e:
|
| 669 |
return None, f"β Error: {str(e)}"
|
| 670 |
|