Update modules/ui.py
Browse files- modules/ui.py +63 -44
modules/ui.py
CHANGED
|
@@ -300,50 +300,69 @@ def display_student_progress(username, lang_code='es'):
|
|
| 300 |
|
| 301 |
st.title(f"Progreso de {username}")
|
| 302 |
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
st.
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 347 |
|
| 348 |
# Añadir logs para depuración
|
| 349 |
if st.checkbox("Mostrar datos de depuración"):
|
|
|
|
| 300 |
|
| 301 |
st.title(f"Progreso de {username}")
|
| 302 |
|
| 303 |
+
with st.expander("Resumen de Actividades y Progreso", expanded=True):
|
| 304 |
+
# Resumen de actividades
|
| 305 |
+
total_entries = len(student_data['entries'])
|
| 306 |
+
st.write(f"Total de análisis realizados: {total_entries}")
|
| 307 |
+
|
| 308 |
+
# Gráfico de tipos de análisis
|
| 309 |
+
analysis_types = [entry['analysis_type'] for entry in student_data['entries']]
|
| 310 |
+
analysis_counts = pd.Series(analysis_types).value_counts()
|
| 311 |
+
|
| 312 |
+
fig, ax = plt.subplots()
|
| 313 |
+
analysis_counts.plot(kind='bar', ax=ax)
|
| 314 |
+
ax.set_title("Tipos de análisis realizados")
|
| 315 |
+
ax.set_xlabel("Tipo de análisis")
|
| 316 |
+
ax.set_ylabel("Cantidad")
|
| 317 |
+
st.pyplot(fig)
|
| 318 |
+
|
| 319 |
+
# Progreso a lo largo del tiempo
|
| 320 |
+
dates = [datetime.fromisoformat(entry['timestamp']) for entry in student_data['entries']]
|
| 321 |
+
analysis_counts = pd.Series(dates).value_counts().sort_index()
|
| 322 |
+
|
| 323 |
+
fig, ax = plt.subplots()
|
| 324 |
+
analysis_counts.plot(kind='line', ax=ax)
|
| 325 |
+
ax.set_title("Análisis realizados a lo largo del tiempo")
|
| 326 |
+
ax.set_xlabel("Fecha")
|
| 327 |
+
ax.set_ylabel("Cantidad de análisis")
|
| 328 |
+
st.pyplot(fig)
|
| 329 |
+
|
| 330 |
+
with st.expander("Histórico de Análisis Morfosintácticos"):
|
| 331 |
+
morphosyntax_entries = [entry for entry in student_data['entries'] if entry['analysis_type'] == 'morphosyntax']
|
| 332 |
+
for entry in morphosyntax_entries:
|
| 333 |
+
st.subheader(f"Análisis del {entry['timestamp']}")
|
| 334 |
+
if entry['arc_diagrams']:
|
| 335 |
+
st.write(entry['arc_diagrams'][0], unsafe_allow_html=True)
|
| 336 |
+
|
| 337 |
+
with st.expander("Histórico de Análisis Semánticos"):
|
| 338 |
+
semantic_entries = [entry for entry in student_data['entries'] if entry['analysis_type'] == 'semantic']
|
| 339 |
+
for entry in semantic_entries:
|
| 340 |
+
st.subheader(f"Análisis del {entry['timestamp']}")
|
| 341 |
+
st.write(f"Archivo analizado: {entry.get('filename', 'Nombre no disponible')}")
|
| 342 |
+
if 'network_diagram' in entry:
|
| 343 |
+
st.image(entry['network_diagram'])
|
| 344 |
+
|
| 345 |
+
with st.expander("Histórico de Análisis Discursivos"):
|
| 346 |
+
discourse_entries = [entry for entry in student_data['entries'] if entry['analysis_type'] == 'discourse']
|
| 347 |
+
for entry in discourse_entries:
|
| 348 |
+
st.subheader(f"Análisis del {entry['timestamp']}")
|
| 349 |
+
st.write(f"Archivo patrón: {entry.get('filename1', 'Nombre no disponible')}")
|
| 350 |
+
st.write(f"Archivo comparado: {entry.get('filename2', 'Nombre no disponible')}")
|
| 351 |
+
if 'combined_graph' in entry:
|
| 352 |
+
st.image(entry['combined_graph'])
|
| 353 |
+
|
| 354 |
+
with st.expander("Histórico de Conversaciones con el ChatBot"):
|
| 355 |
+
if 'chat_history' in student_data:
|
| 356 |
+
for i, chat in enumerate(student_data['chat_history']):
|
| 357 |
+
st.subheader(f"Conversación {i+1} - {chat['timestamp']}")
|
| 358 |
+
for message in chat['messages']:
|
| 359 |
+
if message['role'] == 'user':
|
| 360 |
+
st.write("Usuario: " + message['content'])
|
| 361 |
+
else:
|
| 362 |
+
st.write("Asistente: " + message['content'])
|
| 363 |
+
st.write("---")
|
| 364 |
+
else:
|
| 365 |
+
st.write("No se encontraron conversaciones con el ChatBot.")
|
| 366 |
|
| 367 |
# Añadir logs para depuración
|
| 368 |
if st.checkbox("Mostrar datos de depuración"):
|