Spaces:
Sleeping
Sleeping
Update modules/ui/user_page.py
Browse files- modules/ui/user_page.py +18 -11
modules/ui/user_page.py
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
-
# modules/ui/user_page.py
|
| 2 |
import streamlit as st
|
| 3 |
import logging
|
| 4 |
from datetime import datetime, timezone
|
|
@@ -8,21 +7,27 @@ from dateutil.parser import parse
|
|
| 8 |
logging.basicConfig(level=logging.INFO)
|
| 9 |
logger = logging.getLogger(__name__)
|
| 10 |
|
| 11 |
-
#
|
|
|
|
| 12 |
from ..utils.widget_utils import generate_unique_key
|
| 13 |
from session_state import initialize_session_state, logout
|
|
|
|
| 14 |
from translations import get_translations
|
|
|
|
| 15 |
from ..auth.auth import authenticate_user, authenticate_student, authenticate_admin
|
|
|
|
| 16 |
from ..admin.admin_ui import admin_page
|
|
|
|
| 17 |
from ..chatbot import display_sidebar_chat
|
| 18 |
|
| 19 |
# Students activities
|
| 20 |
from ..studentact.student_activities_v2 import display_student_activities
|
| 21 |
from ..studentact.current_situation_interface import display_current_situation_interface
|
| 22 |
from ..studentact.current_situation_analysis import analyze_text_dimensions
|
| 23 |
-
|
| 24 |
|
| 25 |
##Importaciones desde la configuraci贸n de bases datos #######
|
|
|
|
| 26 |
from ..database.sql_db import (
|
| 27 |
get_user,
|
| 28 |
get_admin_user,
|
|
@@ -32,12 +37,12 @@ from ..database.sql_db import (
|
|
| 32 |
create_student_user,
|
| 33 |
create_teacher_user,
|
| 34 |
create_admin_user,
|
| 35 |
-
update_student_user,
|
| 36 |
-
delete_student_user,
|
| 37 |
record_login,
|
| 38 |
record_logout,
|
| 39 |
get_recent_sessions,
|
| 40 |
-
get_user_total_time,
|
| 41 |
store_application_request,
|
| 42 |
store_student_feedback
|
| 43 |
)
|
|
@@ -62,12 +67,12 @@ from ..database.chat_mongo_db import store_chat_history, get_chat_history
|
|
| 62 |
|
| 63 |
##Importaciones desde los an谩lisis #######
|
| 64 |
from ..morphosyntax.morphosyntax_interface import (
|
| 65 |
-
display_morphosyntax_interface,
|
| 66 |
-
display_arc_diagram
|
| 67 |
)
|
| 68 |
|
| 69 |
from ..semantic.semantic_interface import (
|
| 70 |
-
display_semantic_interface,
|
| 71 |
display_semantic_results
|
| 72 |
)
|
| 73 |
|
|
@@ -75,12 +80,13 @@ from ..semantic.semantic_live_interface import display_semantic_live_interface
|
|
| 75 |
|
| 76 |
from ..discourse.discourse_live_interface import display_discourse_live_interface
|
| 77 |
|
| 78 |
-
from ..discourse.discourse_interface import (
|
| 79 |
display_discourse_interface,
|
| 80 |
display_discourse_results
|
| 81 |
)
|
| 82 |
|
| 83 |
|
|
|
|
| 84 |
####################################################################################
|
| 85 |
def user_page(lang_code, t):
|
| 86 |
logger.info(f"Entrando en user_page para el estudiante: {st.session_state.username}")
|
|
@@ -340,4 +346,5 @@ def display_feedback_form(lang_code, t):
|
|
| 340 |
else:
|
| 341 |
st.error(feedback_t.get('feedback_error', 'Hubo un problema al enviar el formulario. Por favor, intenta de nuevo.'))
|
| 342 |
else:
|
| 343 |
-
st.warning(feedback_t.get('complete_all_fields', 'Por favor, completa todos los campos'))
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import logging
|
| 3 |
from datetime import datetime, timezone
|
|
|
|
| 7 |
logging.basicConfig(level=logging.INFO)
|
| 8 |
logger = logging.getLogger(__name__)
|
| 9 |
|
| 10 |
+
#Importaciones locales.
|
| 11 |
+
|
| 12 |
from ..utils.widget_utils import generate_unique_key
|
| 13 |
from session_state import initialize_session_state, logout
|
| 14 |
+
|
| 15 |
from translations import get_translations
|
| 16 |
+
|
| 17 |
from ..auth.auth import authenticate_user, authenticate_student, authenticate_admin
|
| 18 |
+
|
| 19 |
from ..admin.admin_ui import admin_page
|
| 20 |
+
|
| 21 |
from ..chatbot import display_sidebar_chat
|
| 22 |
|
| 23 |
# Students activities
|
| 24 |
from ..studentact.student_activities_v2 import display_student_activities
|
| 25 |
from ..studentact.current_situation_interface import display_current_situation_interface
|
| 26 |
from ..studentact.current_situation_analysis import analyze_text_dimensions
|
| 27 |
+
|
| 28 |
|
| 29 |
##Importaciones desde la configuraci贸n de bases datos #######
|
| 30 |
+
|
| 31 |
from ..database.sql_db import (
|
| 32 |
get_user,
|
| 33 |
get_admin_user,
|
|
|
|
| 37 |
create_student_user,
|
| 38 |
create_teacher_user,
|
| 39 |
create_admin_user,
|
| 40 |
+
update_student_user, # Agregada
|
| 41 |
+
delete_student_user, # Agregada
|
| 42 |
record_login,
|
| 43 |
record_logout,
|
| 44 |
get_recent_sessions,
|
| 45 |
+
get_user_total_time,
|
| 46 |
store_application_request,
|
| 47 |
store_student_feedback
|
| 48 |
)
|
|
|
|
| 67 |
|
| 68 |
##Importaciones desde los an谩lisis #######
|
| 69 |
from ..morphosyntax.morphosyntax_interface import (
|
| 70 |
+
display_morphosyntax_interface,
|
| 71 |
+
display_arc_diagram
|
| 72 |
)
|
| 73 |
|
| 74 |
from ..semantic.semantic_interface import (
|
| 75 |
+
display_semantic_interface,
|
| 76 |
display_semantic_results
|
| 77 |
)
|
| 78 |
|
|
|
|
| 80 |
|
| 81 |
from ..discourse.discourse_live_interface import display_discourse_live_interface
|
| 82 |
|
| 83 |
+
from ..discourse.discourse_interface import ( # Agregar esta importaci贸n
|
| 84 |
display_discourse_interface,
|
| 85 |
display_discourse_results
|
| 86 |
)
|
| 87 |
|
| 88 |
|
| 89 |
+
|
| 90 |
####################################################################################
|
| 91 |
def user_page(lang_code, t):
|
| 92 |
logger.info(f"Entrando en user_page para el estudiante: {st.session_state.username}")
|
|
|
|
| 346 |
else:
|
| 347 |
st.error(feedback_t.get('feedback_error', 'Hubo un problema al enviar el formulario. Por favor, intenta de nuevo.'))
|
| 348 |
else:
|
| 349 |
+
st.warning(feedback_t.get('complete_all_fields', 'Por favor, completa todos los campos'))
|
| 350 |
+
|