Spaces:
Sleeping
Sleeping
Update modules/ui/user_page.py
Browse files- modules/ui/user_page.py +80 -9
modules/ui/user_page.py
CHANGED
|
@@ -1,22 +1,93 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import logging
|
| 3 |
from datetime import datetime, timezone
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
from ..utils.widget_utils import generate_unique_key
|
| 6 |
-
from
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
-
# Importaciones de componentes de interfaz
|
| 10 |
-
from ..morphosyntax.morphosyntax_interface import display_morphosyntax_interface
|
| 11 |
-
from ..semantic.semantic_interface import display_semantic_interface
|
| 12 |
from ..semantic.semantic_live_interface import display_semantic_live_interface
|
| 13 |
-
|
| 14 |
from ..discourse.discourse_live_interface import display_discourse_live_interface
|
| 15 |
-
from ..studentact.student_activities_v2 import display_student_activities
|
| 16 |
-
from ..chatbot.sidebar_chat import display_sidebar_chat
|
| 17 |
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
|
|
|
| 20 |
def user_page(lang_code, t):
|
| 21 |
logger.info(f"Entrando en user_page para el estudiante: {st.session_state.username}")
|
| 22 |
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import logging
|
| 3 |
from datetime import datetime, timezone
|
| 4 |
+
from dateutil.parser import parse
|
| 5 |
+
|
| 6 |
+
# Configuraci贸n del logger
|
| 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,
|
| 34 |
+
get_student_user,
|
| 35 |
+
get_teacher_user,
|
| 36 |
+
create_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 |
+
)
|
| 49 |
+
|
| 50 |
+
from ..database.mongo_db import (
|
| 51 |
+
get_collection,
|
| 52 |
+
insert_document,
|
| 53 |
+
find_documents,
|
| 54 |
+
update_document,
|
| 55 |
+
delete_document
|
| 56 |
+
)
|
| 57 |
+
|
| 58 |
+
from ..database.morphosintax_mongo_db import (
|
| 59 |
+
store_student_morphosyntax_result,
|
| 60 |
+
get_student_morphosyntax_analysis,
|
| 61 |
+
update_student_morphosyntax_analysis,
|
| 62 |
+
delete_student_morphosyntax_analysis,
|
| 63 |
+
get_student_morphosyntax_data
|
| 64 |
+
)
|
| 65 |
+
|
| 66 |
+
from ..database.chat_mongo_db import store_chat_history, get_chat_history
|
| 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 |
|
|
|
|
|
|
|
|
|
|
| 79 |
from ..semantic.semantic_live_interface import display_semantic_live_interface
|
| 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}")
|
| 93 |
|