AIdeaText commited on
Commit
b386bdd
verified
1 Parent(s): 6644269

Update modules/ui/ui.py

Browse files
Files changed (1) hide show
  1. modules/ui/ui.py +34 -36
modules/ui/ui.py CHANGED
@@ -318,43 +318,41 @@ def user_page(lang_code, t):
318
  for index, tab in enumerate(tabs):
319
  if tab.selected:
320
  st.session_state.selected_tab = index
321
-
322
  with tab:
323
- if index == 0:
324
- display_morphosyntax_interface(
325
- st.session_state.lang_code,
326
- st.session_state.nlp_models,
327
- t.get('TRANSLATIONS', {})
328
- )
329
- elif index == 1:
330
- display_semantic_interface(
331
- st.session_state.lang_code,
332
- st.session_state.nlp_models,
333
- t.get('TRANSLATIONS', {})
334
- )
335
- elif index == 2:
336
- display_discourse_interface(
337
- st.session_state.lang_code,
338
- st.session_state.nlp_models,
339
- t.get('TRANSLATIONS', {})
340
- )
341
- elif index == 3:
342
- # Mostrar actividades del estudiante
343
- display_student_activities(
344
- username=st.session_state.username,
345
- lang_code=st.session_state.lang_code,
346
- t=t.get('ACTIVITIES_TRANSLATIONS', {})
347
- )
348
-
349
- elif index == 4: # Corregido el 铆ndice
350
- display_feedback_form(
351
- st.session_state.lang_code,
352
- t
353
- )
354
-
355
- except Exception as e:
356
- logger.error(f"Error en tab {index}: {str(e)}")
357
- st.error(t.get('tab_error', 'Error al cargar esta secci贸n'))
358
 
359
  # Panel de depuraci贸n (solo visible en desarrollo)
360
  if st.session_state.get('debug_mode', False):
 
318
  for index, tab in enumerate(tabs):
319
  if tab.selected:
320
  st.session_state.selected_tab = index
321
+
322
  with tab:
323
+ try:
324
+ if index == 0:
325
+ display_morphosyntax_interface(
326
+ st.session_state.lang_code,
327
+ st.session_state.nlp_models,
328
+ t.get('TRANSLATIONS', {})
329
+ )
330
+ elif index == 1:
331
+ display_semantic_interface(
332
+ st.session_state.lang_code,
333
+ st.session_state.nlp_models,
334
+ t.get('TRANSLATIONS', {})
335
+ )
336
+ elif index == 2:
337
+ display_discourse_interface(
338
+ st.session_state.lang_code,
339
+ st.session_state.nlp_models,
340
+ t.get('TRANSLATIONS', {})
341
+ )
342
+ elif index == 3:
343
+ display_student_activities(
344
+ username=st.session_state.username,
345
+ lang_code=st.session_state.lang_code,
346
+ t=t.get('ACTIVITIES_TRANSLATIONS', {})
347
+ )
348
+ elif index == 4:
349
+ display_feedback_form(
350
+ st.session_state.lang_code,
351
+ t
352
+ )
353
+ except Exception as e:
354
+ logger.error(f"Error en tab {index}: {str(e)}")
355
+ st.error(t.get('tab_error', 'Error al cargar esta secci贸n'))
 
 
356
 
357
  # Panel de depuraci贸n (solo visible en desarrollo)
358
  if st.session_state.get('debug_mode', False):