Spaces:
Running
Running
Update modules/database/semantic_mongo_db.py
Browse files
modules/database/semantic_mongo_db.py
CHANGED
|
@@ -50,20 +50,19 @@ def store_student_semantic_result(username, text, analysis_result):
|
|
| 50 |
|
| 51 |
# Insertar en MongoDB
|
| 52 |
result = insert_document(COLLECTION_NAME, analysis_document)
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
if result and '_id' in result:
|
| 56 |
-
logger.info(f"Análisis semántico guardado con ID: {result['_id']} para el usuario: {username}")
|
| 57 |
return True
|
| 58 |
|
| 59 |
-
|
| 60 |
-
logger.error(f"No se pudo insertar el documento en MongoDB: {result}")
|
| 61 |
return False
|
| 62 |
|
| 63 |
except Exception as e:
|
| 64 |
logger.error(f"Error al guardar el análisis semántico: {str(e)}")
|
| 65 |
return False
|
| 66 |
|
|
|
|
|
|
|
| 67 |
####################################################################################
|
| 68 |
def get_student_semantic_analysis(username, limit=10):
|
| 69 |
"""
|
|
|
|
| 50 |
|
| 51 |
# Insertar en MongoDB
|
| 52 |
result = insert_document(COLLECTION_NAME, analysis_document)
|
| 53 |
+
if result:
|
| 54 |
+
logger.info(f"Análisis semántico guardado con ID: {result} para el usuario: {username}")
|
|
|
|
|
|
|
| 55 |
return True
|
| 56 |
|
| 57 |
+
logger.error("No se pudo insertar el documento en MongoDB")
|
|
|
|
| 58 |
return False
|
| 59 |
|
| 60 |
except Exception as e:
|
| 61 |
logger.error(f"Error al guardar el análisis semántico: {str(e)}")
|
| 62 |
return False
|
| 63 |
|
| 64 |
+
|
| 65 |
+
|
| 66 |
####################################################################################
|
| 67 |
def get_student_semantic_analysis(username, limit=10):
|
| 68 |
"""
|