Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -24,12 +24,25 @@ def start_exam(exam_choice, start_question, audio_enabled):
|
|
24 |
|
25 |
return (
|
26 |
# Hide start screen elements
|
27 |
-
gr.update(visible=False),
|
|
|
|
|
|
|
28 |
gr.update(visible=False), # Hide the audio_checkbox
|
|
|
29 |
# Show quiz elements
|
30 |
-
gr.update(visible=True),
|
31 |
-
|
32 |
-
gr.update(visible=True),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
)
|
34 |
|
35 |
def display_question(index, audio_enabled):
|
|
|
24 |
|
25 |
return (
|
26 |
# Hide start screen elements
|
27 |
+
gr.update(visible=False), # Hide title
|
28 |
+
gr.update(visible=False), # Hide description
|
29 |
+
gr.update(visible=False), # Hide exam_selector
|
30 |
+
gr.update(visible=False), # Hide start_button
|
31 |
gr.update(visible=False), # Hide the audio_checkbox
|
32 |
+
|
33 |
# Show quiz elements
|
34 |
+
gr.update(visible=True), # Show question_text
|
35 |
+
question, # Question to display
|
36 |
+
gr.update(choices=options, visible=True), # Update Radio choices and make visible
|
37 |
+
gr.update(visible=True), # Show answer_button
|
38 |
+
gr.update(visible=True),# Show next_button
|
39 |
+
gr.update(visible=True), # Show prev_button
|
40 |
+
gr.update(visible=True), # Show home_button
|
41 |
+
start_question, "", # Update the question state
|
42 |
+
audio_path, # Provide the audio_path
|
43 |
+
gr.update(visible=True), # Show explain_button
|
44 |
+
gr.update(visible=True),
|
45 |
+
None # None for the audio stop signal
|
46 |
)
|
47 |
|
48 |
def display_question(index, audio_enabled):
|