mikaelJ46 commited on
Commit
63e49c7
·
verified ·
1 Parent(s): 259a295

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +51 -51
app.py CHANGED
@@ -815,39 +815,39 @@ with gr.Blocks(title="UNEB Exam Prep - Primary 6 & 7", theme=gr.themes.Soft(), c
815
  )
816
 
817
  with gr.Tabs():
818
- # Method 1: Draw
819
- with gr.Tab("✏️ Draw Answers"):
820
- canvas = gr.Sketchpad(
821
- label="Draw or write your answers here",
822
- type="pil",
823
- height=500,
824
- brush=gr.Brush(
825
- colors=["#000000", "#0000FF", "#FF0000"],
826
- default_size=4
827
- )
828
- )
829
- canvas_status = gr.Textbox(
830
- label="Canvas Status",
831
- interactive=False,
832
- value="Ready to draw"
833
- )
834
-
835
- # Method 2: Upload
836
- with gr.Tab("📸 Upload Photo"):
837
- upload_image = gr.Image(
838
- label="Upload photo of your written work",
839
- type="pil",
840
- height=500
841
- )
842
- upload_status = gr.Textbox(
843
- label="Upload Status",
844
- interactive=False,
845
- value="Ready to upload"
846
- )
847
-
848
- # Method 3: Type
849
- with gr.Tab(" Type Answers"):
850
- gr.Markdown("""
851
  ### 📝 Type Your Answers
852
 
853
  **Instructions:** Type each answer in the box below. Use one of these formats:
@@ -874,24 +874,24 @@ with gr.Blocks(title="UNEB Exam Prep - Primary 6 & 7", theme=gr.themes.Soft(), c
874
  Q2: Your answer here
875
  Q3: Your answer here
876
  ```
877
- """)
878
-
879
- typed_answers = gr.Textbox(
880
- label="Type Your Answers Here",
881
- lines=20,
882
- placeholder="Type your answers using any of the formats shown above...",
883
- elem_classes="answer-input"
884
- )
885
-
886
- # Combined submit button
887
- with gr.Row():
888
- submit_btn = gr.Button(" Submit for Correction", variant="primary", size="lg")
889
-
890
- submit_status = gr.Textbox(
891
- label="Submission Status",
892
- interactive=False,
893
- lines=2
894
- )
895
 
896
  # Improved submission handler with better parsing
897
  def submit_answers(canvas_input, upload_input, typed_input):
 
815
  )
816
 
817
  with gr.Tabs():
818
+ # Method 1: Draw
819
+ with gr.Tab("✏️ Draw Answers"):
820
+ canvas = gr.Sketchpad(
821
+ label="Draw or write your answers here",
822
+ type="pil",
823
+ height=500,
824
+ brush=gr.Brush(
825
+ colors=["#000000", "#0000FF", "#FF0000"],
826
+ default_size=4
827
+ )
828
+ )
829
+ canvas_status = gr.Textbox(
830
+ label="Canvas Status",
831
+ interactive=False,
832
+ value="Ready to draw"
833
+ )
834
+
835
+ # Method 2: Upload
836
+ with gr.Tab("📸 Upload Photo"):
837
+ upload_image = gr.Image(
838
+ label="Upload photo of your written work",
839
+ type="pil",
840
+ height=500
841
+ )
842
+ upload_status = gr.Textbox(
843
+ label="Upload Status",
844
+ interactive=False,
845
+ value="Ready to upload"
846
+ )
847
+
848
+ # Method 3: Type
849
+ with gr.Tab(" Type Answers"):
850
+ gr.Markdown("""
851
  ### 📝 Type Your Answers
852
 
853
  **Instructions:** Type each answer in the box below. Use one of these formats:
 
874
  Q2: Your answer here
875
  Q3: Your answer here
876
  ```
877
+ """)
878
+
879
+ typed_answers = gr.Textbox(
880
+ label="Type Your Answers Here",
881
+ lines=20,
882
+ placeholder="Type your answers using any of the formats shown above...",
883
+ elem_classes="answer-input"
884
+ )
885
+
886
+ # Combined submit button
887
+ with gr.Row():
888
+ submit_btn = gr.Button(" Submit for Correction", variant="primary", size="lg")
889
+
890
+ submit_status = gr.Textbox(
891
+ label="Submission Status",
892
+ interactive=False,
893
+ lines=2
894
+ )
895
 
896
  # Improved submission handler with better parsing
897
  def submit_answers(canvas_input, upload_input, typed_input):