capradeepgujaran commited on
Commit
5eb4568
1 Parent(s): 2fa9829

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -8
app.py CHANGED
@@ -739,19 +739,15 @@ def create_quiz_interface():
739
  step=1,
740
  label="Number of Questions"
741
  )
 
 
742
  clear_btn = gr.Button("Clear Learning Content", variant="secondary", size="sm")
 
743
  with gr.Row():
744
  participant_photo = gr.Image(label="Your Photo (Optional)", type="filepath")
745
 
746
  generate_btn = gr.Button("Generate Assessment", variant="primary", size="lg")
747
- def clear_content():
748
- quiz_app.clear_learning_content()
749
- return gr.update(value="")
750
 
751
- clear_btn.click(
752
- fn=clear_content,
753
- outputs=[text_input]
754
- )
755
  # Assessment Tab
756
  with gr.Tab(id=2, label="📝 Step 2: Take Assessment"):
757
  with gr.Column() as main_container:
@@ -811,8 +807,15 @@ def create_quiz_interface():
811
  interactive=False # Make it non-editable
812
  )
813
  certificate_display = gr.Image(label="Your Certificate")
 
 
 
 
 
 
 
 
814
 
815
- # Update view_cert_btn click handler to show certification tab
816
  def show_certificate_tab():
817
  return [
818
  gr.update(visible=True), # Make cert_tab visible
 
739
  step=1,
740
  label="Number of Questions"
741
  )
742
+
743
+ # Add clear button
744
  clear_btn = gr.Button("Clear Learning Content", variant="secondary", size="sm")
745
+
746
  with gr.Row():
747
  participant_photo = gr.Image(label="Your Photo (Optional)", type="filepath")
748
 
749
  generate_btn = gr.Button("Generate Assessment", variant="primary", size="lg")
 
 
 
750
 
 
 
 
 
751
  # Assessment Tab
752
  with gr.Tab(id=2, label="📝 Step 2: Take Assessment"):
753
  with gr.Column() as main_container:
 
807
  interactive=False # Make it non-editable
808
  )
809
  certificate_display = gr.Image(label="Your Certificate")
810
+ def clear_content():
811
+ quiz_app.clear_learning_content()
812
+ return gr.update(value="")
813
+
814
+ clear_btn.click(
815
+ fn=clear_content,
816
+ outputs=[text_input]
817
+ )
818
 
 
819
  def show_certificate_tab():
820
  return [
821
  gr.update(visible=True), # Make cert_tab visible