AIdeaText commited on
Commit
28969c0
·
verified ·
1 Parent(s): 42d7850

Update modules/studentact/student_activities_v2.py

Browse files
modules/studentact/student_activities_v2.py CHANGED
@@ -472,6 +472,12 @@ def display_morphosyntax_activities(username: str, t: dict):
472
  def display_semantic_activities(username: str, t: dict):
473
  """Muestra actividades de análisis semántico"""
474
  try:
 
 
 
 
 
 
475
  return
476
 
477
  logger.info(f"Procesando {len(analyses)} análisis semánticos")
@@ -481,9 +487,6 @@ def display_semantic_activities(username: str, t: dict):
481
  # Verificar campos necesarios
482
  if not all(key in analysis for key in ['timestamp', 'concept_graph']):
483
  logger.warning(f"Análisis incompleto: {analysis.keys()}")
484
-
485
-
486
-
487
  continue
488
 
489
  # Formatear fecha
@@ -506,10 +509,12 @@ def display_semantic_activities(username: str, t: dict):
506
  # Si es string base64, decodificar
507
  image_bytes = base64.b64decode(image_data)
508
 
509
-
510
  logger.debug(f"Longitud de bytes de imagen: {len(image_bytes)}")
511
 
512
  # Mostrar imagen
 
 
 
513
  use_column_width=True
514
  )
515
  logger.debug("Gráfico mostrado exitosamente")
@@ -518,10 +523,13 @@ def display_semantic_activities(username: str, t: dict):
518
  logger.error(f"Error procesando gráfico: {str(img_error)}")
519
  st.error(t.get('error_loading_graph', 'Error al cargar el gráfico'))
520
  else:
521
-
522
  st.info(t.get('no_graph', 'No hay visualización disponible'))
523
 
524
  except Exception as e:
 
 
 
 
525
  logger.error(f"Error mostrando análisis semántico: {str(e)}")
526
  st.error(t.get('error_semantic', 'Error al mostrar análisis semántico'))
527
 
 
472
  def display_semantic_activities(username: str, t: dict):
473
  """Muestra actividades de análisis semántico"""
474
  try:
475
+ logger.info(f"Recuperando análisis semántico para {username}")
476
+ analyses = get_student_semantic_analysis(username)
477
+
478
+ if not analyses:
479
+ logger.info("No se encontraron análisis semánticos")
480
+ st.info(t.get('no_semantic_analyses', 'No hay análisis semánticos registrados'))
481
  return
482
 
483
  logger.info(f"Procesando {len(analyses)} análisis semánticos")
 
487
  # Verificar campos necesarios
488
  if not all(key in analysis for key in ['timestamp', 'concept_graph']):
489
  logger.warning(f"Análisis incompleto: {analysis.keys()}")
 
 
 
490
  continue
491
 
492
  # Formatear fecha
 
509
  # Si es string base64, decodificar
510
  image_bytes = base64.b64decode(image_data)
511
 
 
512
  logger.debug(f"Longitud de bytes de imagen: {len(image_bytes)}")
513
 
514
  # Mostrar imagen
515
+ st.image(
516
+ image_bytes,
517
+ caption=t.get('concept_network', 'Red de Conceptos'),
518
  use_column_width=True
519
  )
520
  logger.debug("Gráfico mostrado exitosamente")
 
523
  logger.error(f"Error procesando gráfico: {str(img_error)}")
524
  st.error(t.get('error_loading_graph', 'Error al cargar el gráfico'))
525
  else:
 
526
  st.info(t.get('no_graph', 'No hay visualización disponible'))
527
 
528
  except Exception as e:
529
+ logger.error(f"Error procesando análisis individual: {str(e)}")
530
+ continue
531
+
532
+ except Exception as e:
533
  logger.error(f"Error mostrando análisis semántico: {str(e)}")
534
  st.error(t.get('error_semantic', 'Error al mostrar análisis semántico'))
535