AIdeaText commited on
Commit
0d7ac85
1 Parent(s): 9f1e247

Update modules/database.py

Browse files
Files changed (1) hide show
  1. modules/database.py +5 -4
modules/database.py CHANGED
@@ -89,7 +89,6 @@ def create_user(user_data):
89
  return False
90
 
91
  # Funciones para Cosmos DB MongoDB API (análisis de texto)
92
-
93
  def get_student_data(username):
94
  if analysis_collection is None:
95
  logger.error("La conexión a MongoDB no está inicializada")
@@ -110,10 +109,12 @@ def get_student_data(username):
110
  }
111
 
112
  for entry in cursor:
113
- formatted_data["entries"].append({
114
  "timestamp": entry["timestamp"].isoformat(),
115
- "text": entry["text"]
116
- })
 
 
117
  formatted_data["entries_count"] += 1
118
 
119
  # Agregar conteo de palabras
 
89
  return False
90
 
91
  # Funciones para Cosmos DB MongoDB API (análisis de texto)
 
92
  def get_student_data(username):
93
  if analysis_collection is None:
94
  logger.error("La conexión a MongoDB no está inicializada")
 
109
  }
110
 
111
  for entry in cursor:
112
+ entry_data = {
113
  "timestamp": entry["timestamp"].isoformat(),
114
+ "text": entry["text"],
115
+ "word_count": entry.get("word_count", {})
116
+ }
117
+ formatted_data["entries"].append(entry_data)
118
  formatted_data["entries_count"] += 1
119
 
120
  # Agregar conteo de palabras