Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -298,7 +298,6 @@ def reading_component():
|
|
298 |
|
299 |
for i, answer in enumerate(answers):
|
300 |
if i < len(passage["questions"]):
|
301 |
-
# Simple check - in a real app this would be more sophisticated
|
302 |
if answer and len(answer.strip()) > 0:
|
303 |
results.append(f"Question {i+1}: Accepted ✓")
|
304 |
else:
|
@@ -315,20 +314,13 @@ def reading_component():
|
|
315 |
questions_out = gr.JSON(label="Questions")
|
316 |
passage_json = gr.Textbox(visible=False)
|
317 |
|
|
|
318 |
refresh_btn.click(
|
319 |
fn=display_reading_passage,
|
320 |
inputs=[gr.Textbox(level, visible=False)],
|
321 |
outputs=[title_out, text_out, questions_out, passage_json]
|
322 |
)
|
323 |
|
324 |
-
# Initialize with a reading passage
|
325 |
-
refresh_btn.click(
|
326 |
-
fn=lambda: None,
|
327 |
-
inputs=None,
|
328 |
-
outputs=None,
|
329 |
-
_js="() => {setTimeout(() => {document.querySelector('#" + refresh_btn.elem_id + "').click();}, 100);}"
|
330 |
-
)
|
331 |
-
|
332 |
# Answer section
|
333 |
answer_boxes = []
|
334 |
for i in range(4): # Max 4 questions per passage
|
|
|
298 |
|
299 |
for i, answer in enumerate(answers):
|
300 |
if i < len(passage["questions"]):
|
|
|
301 |
if answer and len(answer.strip()) > 0:
|
302 |
results.append(f"Question {i+1}: Accepted ✓")
|
303 |
else:
|
|
|
314 |
questions_out = gr.JSON(label="Questions")
|
315 |
passage_json = gr.Textbox(visible=False)
|
316 |
|
317 |
+
# Initial load of reading passage
|
318 |
refresh_btn.click(
|
319 |
fn=display_reading_passage,
|
320 |
inputs=[gr.Textbox(level, visible=False)],
|
321 |
outputs=[title_out, text_out, questions_out, passage_json]
|
322 |
)
|
323 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
324 |
# Answer section
|
325 |
answer_boxes = []
|
326 |
for i in range(4): # Max 4 questions per passage
|