Spaces:
Sleeping
Sleeping
Remove visible parameter from Results tab - use only selected
Browse files1279 unmodified lines1280128112821283128412851286279 unmodified lines15661567156815691570157115729 unmodified lines158215831584158515861587158834 unmodified lines162316241625162616271628162956 unmodified lines168616871688168916901691169256 unmodified lines17491750175117521753175417551279 unmodified lineschanges_diff_html = gr.HTML("")# ββ Results Tab (shown after Submit) ββββββββββββββββββwith gr.Tab("π Results", id=4, visible=False) as results_tab:score_summary_html = gr.HTML("")with gr.Tabs():279 unmodified lines_loading = '<p style="text-align:center;padding:40px;color:#888;font-size:1.2em;">β³ Running testsβ¦</p>'yield (gr.update(selected=4), # Switch to Results tabgr.update(visible=True), # Show Results tab_loading, "", "", "", # Show loading message in results areasubmit_count,"", # debug console9 unmodified linesif not workspace_path:sys.stdout = original_stdoutyield (gr.update(selected=4), gr.update(visible=True), "No challenge loaded.", "", "", "", submit_count, log_capture.getvalue(), "β No workspace loaded")returnprint(f"[{datetime.now().strftime('%H:%M:%S')}] π Starting submission evaluation...")34 unmodified lines# Return results to user IMMEDIATELYyield (gr.update(selected=4), # Stay on Results tabgr.update(visible=True), # Ensure Results tab is visiblescore_html, combined_diff, test_html, hints_html,new_count,debug_logs,56 unmodified linesdebug_logs = log_capture.getvalue() + f"\n\nβ ERROR:\n{error_details}"sys.stdout = original_stdout # Restore stdouterr = f"<p style='color:#ef4444;padding:20px;font-family:monospace;'>β Error during evaluation:<br>{exc}</p>"yield (gr.update(selected=4), gr.update(visible=True), err, "", "", "", submit_count, debug_logs, debug_logs)finally:sys.stdout = original_stdout # Always restore stdout56 unmodified linesworkspace_state, hint_log_state, user_name_state],outputs=[left_tabs, # Switch to Results tabresults_tab, # Make Results tab visiblescore_summary_html,results_changes_html,results_test_html,1279 unmodified lines1280128112821283128412851286279 unmodified lines1566156715681569157015719 unmodified lines158115821583158415851586158734 unmodified lines16221623162416251626162756 unmodified lines168416851686168716881689169056 unmodified lines1747174817491750175117521279 unmodified lineschanges_diff_html = gr.HTML("")# ββ Results Tab (shown after Submit) ββββββββββββββββββwith gr.Tab("π Results", id=4):score_summary_html = gr.HTML("")with gr.Tabs():279 unmodified lines_loading = '<p style="text-align:center;padding:40px;color:#888;font-size:1.2em;">β³ Running testsβ¦</p>'yield (gr.update(selected=4), # Switch to Results tab_loading, "", "", "", # Show loading message in results areasubmit_count,"", # debug console9 unmodified linesif not workspace_path:sys.stdout = original_stdoutyield (gr.update(selected=4), "No challenge loaded.", "", "", "", submit_count, log_capture.getvalue(), "β No workspace loaded")returnprint(f"[{datetime.now().strftime('%H:%M:%S')}] π Starting submission evaluation...")34 unmodified lines# Return results to user IMMEDIATELYyield (gr.update(selected=4), # Stay on Results tabscore_html, combined_diff, test_html, hints_html,new_count,debug_logs,56 unmodified linesdebug_logs = log_capture.getvalue() + f"\n\nβ ERROR:\n{error_details}"sys.stdout = original_stdout # Restore stdouterr = f"<p style='color:#ef4444;padding:20px;font-family:monospace;'>β Error during evaluation:<br>{exc}</p>"yield (gr.update(selected=4), err, "", "", "", submit_count, debug_logs, debug_logs)finally:sys.stdout = original_stdout # Always restore stdout56 unmodified linesworkspace_state, hint_log_state, user_name_state],outputs=[left_tabs, # Switch to Results tabscore_summary_html,results_changes_html,results_test_html,
student_interface.py+3-6