Update modules/ui/ui.py
Browse files- modules/ui/ui.py +12 -33
modules/ui/ui.py
CHANGED
@@ -288,19 +288,12 @@ def user_page(lang_code, t):
|
|
288 |
|
289 |
st.markdown("---")
|
290 |
|
291 |
-
|
292 |
-
selected_tab = st.session_state.get('selected_tab', 0)
|
293 |
-
|
294 |
-
tabs = st.tabs([
|
295 |
-
t.get('morpho_tab', 'Análisis Morfosintáctico'),
|
296 |
-
t.get('semantic_tab', 'Análisis Semántico'),
|
297 |
-
t.get('activities_tab', 'Mis Actividades'),
|
298 |
-
t.get('feedback_tab', 'Formulario de Comentarios')
|
299 |
-
])
|
300 |
|
301 |
# Usar el tab seleccionado si existe
|
302 |
selected_tab = st.session_state.get('selected_tab', 0)
|
303 |
|
|
|
304 |
tabs = st.tabs([
|
305 |
t.get('morpho_tab', 'Análisis Morfosintáctico'),
|
306 |
t.get('semantic_tab', 'Análisis Semántico'),
|
@@ -311,42 +304,28 @@ def user_page(lang_code, t):
|
|
311 |
# Asegurarnos de que el tab seleccionado sea válido
|
312 |
selected_tab = min(selected_tab, len(tabs) - 1)
|
313 |
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
elif selected_tab == 1:
|
322 |
-
display_semantic_interface(
|
323 |
-
st.session_state.lang_code,
|
324 |
-
st.session_state.nlp_models,
|
325 |
-
t.get('TRANSLATIONS', {})
|
326 |
-
)
|
327 |
-
elif selected_tab == 2:
|
328 |
-
if 'user_data' in st.session_state and st.session_state.user_data:
|
329 |
-
display_student_progress(st.session_state.username, st.session_state.lang_code, t)
|
330 |
-
else:
|
331 |
-
st.warning(t.get('no_data_warning', 'No se encontraron datos para este estudiante.'))
|
332 |
-
elif selected_tab == 3:
|
333 |
-
display_feedback_form(st.session_state.lang_code, t)
|
334 |
|
335 |
with tabs[1]:
|
336 |
display_semantic_interface(
|
337 |
st.session_state.lang_code,
|
338 |
st.session_state.nlp_models,
|
339 |
-
|
340 |
-
t.get('TRANSLATIONS', {}) # Asegurarse de que pasamos el diccionario completo
|
341 |
)
|
342 |
|
343 |
with tabs[2]:
|
344 |
if 'user_data' in st.session_state and st.session_state.user_data:
|
345 |
-
|
346 |
else:
|
347 |
st.warning(t.get('no_data_warning', 'No se encontraron datos para este estudiante.'))
|
348 |
|
349 |
-
|
350 |
display_feedback_form(st.session_state.lang_code, t)
|
351 |
|
352 |
# Información de depuración
|
|
|
288 |
|
289 |
st.markdown("---")
|
290 |
|
291 |
+
st.markdown("---")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
292 |
|
293 |
# Usar el tab seleccionado si existe
|
294 |
selected_tab = st.session_state.get('selected_tab', 0)
|
295 |
|
296 |
+
# Definir los tabs una sola vez
|
297 |
tabs = st.tabs([
|
298 |
t.get('morpho_tab', 'Análisis Morfosintáctico'),
|
299 |
t.get('semantic_tab', 'Análisis Semántico'),
|
|
|
304 |
# Asegurarnos de que el tab seleccionado sea válido
|
305 |
selected_tab = min(selected_tab, len(tabs) - 1)
|
306 |
|
307 |
+
# Manejar cada tab
|
308 |
+
with tabs[0]:
|
309 |
+
display_morphosyntax_interface(
|
310 |
+
st.session_state.lang_code,
|
311 |
+
st.session_state.nlp_models,
|
312 |
+
t.get('TRANSLATIONS', {})
|
313 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
314 |
|
315 |
with tabs[1]:
|
316 |
display_semantic_interface(
|
317 |
st.session_state.lang_code,
|
318 |
st.session_state.nlp_models,
|
319 |
+
t.get('TRANSLATIONS', {})
|
|
|
320 |
)
|
321 |
|
322 |
with tabs[2]:
|
323 |
if 'user_data' in st.session_state and st.session_state.user_data:
|
324 |
+
display_student_progress(st.session_state.username, st.session_state.lang_code, t)
|
325 |
else:
|
326 |
st.warning(t.get('no_data_warning', 'No se encontraron datos para este estudiante.'))
|
327 |
|
328 |
+
with tabs[3]:
|
329 |
display_feedback_form(st.session_state.lang_code, t)
|
330 |
|
331 |
# Información de depuración
|