mikaelJ46 commited on
Commit
4d999d2
Β·
verified Β·
1 Parent(s): ee9b7cd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
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
- return pdf_path, f"βœ… Downloaded PDF: {os.path.abspath(pdf_path)}"
 
498
  # Fallback to text
499
  filepath = download_questions_file(session.current_questions, session.current_topic, session.current_grade)
500
- return filepath, f"βœ… Downloaded TXT: {os.path.abspath(filepath)}"
 
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
- return filepath, f"βœ… Downloaded! File: {os.path.abspath(filepath)}"
 
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