capradeepgujaran commited on
Commit
9fe7ced
1 Parent(s): 60b2489

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -6
app.py CHANGED
@@ -681,16 +681,23 @@ def create_quiz_interface():
681
  visible=False
682
  )
683
 
684
-
685
- # Certification Tab
686
- with gr.Tab(id=3, label="🎓 Step 3: Get Certified"):
687
  score_display = gr.Number(label="Your Score", visible=False)
688
  course_name = gr.Textbox(
689
  label="Certification Title",
690
- value="Professional Assessment Certification"
 
691
  )
692
  certificate_display = gr.Image(label="Your Certificate")
693
 
 
 
 
 
 
 
 
694
 
695
  # Helper Functions
696
  def on_generate_questions(text, num_questions):
@@ -922,8 +929,8 @@ def create_quiz_interface():
922
  )
923
 
924
  view_cert_btn.click(
925
- fn=lambda: gr.update(selected=3),
926
- outputs=tabs
927
  )
928
 
929
  current_options.change(
 
681
  visible=False
682
  )
683
 
684
+ # Certification Tab (Hidden by default)
685
+ with gr.Tab(id=3, label="🎓 Step 3: Get Certified", visible=False) as cert_tab:
 
686
  score_display = gr.Number(label="Your Score", visible=False)
687
  course_name = gr.Textbox(
688
  label="Certification Title",
689
+ value="Professional Assessment Certification",
690
+ interactive=False # Make it non-editable
691
  )
692
  certificate_display = gr.Image(label="Your Certificate")
693
 
694
+ # Update view_cert_btn click handler to show certification tab
695
+ def show_certificate_tab():
696
+ return [
697
+ gr.update(visible=True), # Make cert_tab visible
698
+ gr.update(selected=3) # Switch to cert_tab
699
+ ]
700
+
701
 
702
  # Helper Functions
703
  def on_generate_questions(text, num_questions):
 
929
  )
930
 
931
  view_cert_btn.click(
932
+ fn=show_certificate_tab,
933
+ outputs=[cert_tab, tabs]
934
  )
935
 
936
  current_options.change(