Update modules/database.py
Browse files- 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 |
-
|
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
|