Update modules/ui.py
Browse files- modules/ui.py +14 -6
modules/ui.py
CHANGED
|
@@ -1,10 +1,11 @@
|
|
| 1 |
# modules/ui.py
|
| 2 |
# Importaciones estandar de python
|
| 3 |
import streamlit as st
|
|
|
|
| 4 |
from spacy import displacy
|
| 5 |
import re
|
|
|
|
| 6 |
from .morpho_analysis import POS_TRANSLATIONS # Asegúrate de que esta importación esté presente
|
| 7 |
-
from datetime import datetime
|
| 8 |
import matplotlib.pyplot as plt
|
| 9 |
import matplotlib
|
| 10 |
matplotlib.use('Agg')
|
|
@@ -79,11 +80,18 @@ def display_chat_interface():
|
|
| 79 |
|
| 80 |
##########################################################################
|
| 81 |
|
| 82 |
-
def display_student_progress(
|
| 83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
|
| 85 |
-
if student_data
|
| 86 |
-
st.success(f"Datos obtenidos exitosamente para {
|
| 87 |
|
| 88 |
# Mostrar estadísticas generales
|
| 89 |
st.header("Estadísticas Generales")
|
|
@@ -131,7 +139,7 @@ def display_student_progress(student_data):
|
|
| 131 |
with st.expander(f"Entrada {i+1} - {entry['timestamp']}"):
|
| 132 |
st.write(entry['text'])
|
| 133 |
else:
|
| 134 |
-
st.warning("No se encontraron
|
| 135 |
st.info("Intenta realizar algunos análisis de texto primero.")
|
| 136 |
|
| 137 |
##########################################################################
|
|
|
|
| 1 |
# modules/ui.py
|
| 2 |
# Importaciones estandar de python
|
| 3 |
import streamlit as st
|
| 4 |
+
from datetime import datetime
|
| 5 |
from spacy import displacy
|
| 6 |
import re
|
| 7 |
+
import base64
|
| 8 |
from .morpho_analysis import POS_TRANSLATIONS # Asegúrate de que esta importación esté presente
|
|
|
|
| 9 |
import matplotlib.pyplot as plt
|
| 10 |
import matplotlib
|
| 11 |
matplotlib.use('Agg')
|
|
|
|
| 80 |
|
| 81 |
##########################################################################
|
| 82 |
|
| 83 |
+
def display_student_progress(username):
|
| 84 |
+
student_data = get_student_data(username)
|
| 85 |
+
|
| 86 |
+
if student_data is None:
|
| 87 |
+
st.warning("No se encontraron datos para este estudiante.")
|
| 88 |
+
st.info("Intenta realizar algunos análisis de texto primero.")
|
| 89 |
+
return
|
| 90 |
+
|
| 91 |
+
st.title(f"Progreso de {username}")
|
| 92 |
|
| 93 |
+
if student_data['entries_count'] > 0:
|
| 94 |
+
st.success(f"Datos obtenidos exitosamente para {username}")
|
| 95 |
|
| 96 |
# Mostrar estadísticas generales
|
| 97 |
st.header("Estadísticas Generales")
|
|
|
|
| 139 |
with st.expander(f"Entrada {i+1} - {entry['timestamp']}"):
|
| 140 |
st.write(entry['text'])
|
| 141 |
else:
|
| 142 |
+
st.warning("No se encontraron entradas para este estudiante.")
|
| 143 |
st.info("Intenta realizar algunos análisis de texto primero.")
|
| 144 |
|
| 145 |
##########################################################################
|