Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -620,10 +620,10 @@ def create_quiz_interface():
|
|
| 620 |
|
| 621 |
# Results Section in Assessment Tab
|
| 622 |
with gr.Column(visible=False) as results_group:
|
|
|
|
| 623 |
feedback_box = gr.Markdown("")
|
| 624 |
gr.Markdown("---") # Separator
|
| 625 |
with gr.Row(equal_height=True):
|
| 626 |
-
# Only one of these buttons will be visible based on pass/fail
|
| 627 |
reset_btn = gr.Button(
|
| 628 |
"Reset Quiz",
|
| 629 |
variant="secondary",
|
|
@@ -646,6 +646,7 @@ def create_quiz_interface():
|
|
| 646 |
)
|
| 647 |
certificate_display = gr.Image(label="Your Certificate")
|
| 648 |
|
|
|
|
| 649 |
# Helper Functions
|
| 650 |
def on_generate_questions(text, num_questions):
|
| 651 |
if not text.strip():
|
|
@@ -848,17 +849,16 @@ def create_quiz_interface():
|
|
| 848 |
feedback_box,
|
| 849 |
results_group,
|
| 850 |
score_display,
|
| 851 |
-
result_message,
|
| 852 |
question_box,
|
| 853 |
reset_btn,
|
| 854 |
view_cert_btn,
|
| 855 |
-
back_to_assessment,
|
| 856 |
tabs
|
| 857 |
]
|
| 858 |
)
|
| 859 |
|
| 860 |
reset_btn.click(
|
| 861 |
-
fn=
|
| 862 |
inputs=[text_input, num_questions],
|
| 863 |
outputs=[
|
| 864 |
question_display,
|
|
|
|
| 620 |
|
| 621 |
# Results Section in Assessment Tab
|
| 622 |
with gr.Column(visible=False) as results_group:
|
| 623 |
+
result_message = gr.Markdown("") # Added this component
|
| 624 |
feedback_box = gr.Markdown("")
|
| 625 |
gr.Markdown("---") # Separator
|
| 626 |
with gr.Row(equal_height=True):
|
|
|
|
| 627 |
reset_btn = gr.Button(
|
| 628 |
"Reset Quiz",
|
| 629 |
variant="secondary",
|
|
|
|
| 646 |
)
|
| 647 |
certificate_display = gr.Image(label="Your Certificate")
|
| 648 |
|
| 649 |
+
|
| 650 |
# Helper Functions
|
| 651 |
def on_generate_questions(text, num_questions):
|
| 652 |
if not text.strip():
|
|
|
|
| 849 |
feedback_box,
|
| 850 |
results_group,
|
| 851 |
score_display,
|
| 852 |
+
result_message, # Now properly defined
|
| 853 |
question_box,
|
| 854 |
reset_btn,
|
| 855 |
view_cert_btn,
|
|
|
|
| 856 |
tabs
|
| 857 |
]
|
| 858 |
)
|
| 859 |
|
| 860 |
reset_btn.click(
|
| 861 |
+
fn=on_generate_questions,
|
| 862 |
inputs=[text_input, num_questions],
|
| 863 |
outputs=[
|
| 864 |
question_display,
|