update timestamp
Browse files- modules/database/backUp/database.py +2 -2
- modules/database/chat_mongo_db.py +1 -1
- modules/database/claude_recommendations_mongo_db.py +1 -1
- modules/database/current_situation_mongo_db.py +1 -1
- modules/database/discourse_mongo_db.py +1 -1
- modules/database/morphosintax_mongo_db.py +1 -1
- modules/database/morphosyntax_iterative_mongo_db.py +2 -2
- modules/database/semantic_mongo_db.py +1 -1
- modules/database/semantic_mongo_live_db.py +1 -1
- modules/database/sql_db.py +1 -1
- modules/database/writing_progress_mongo_db.py +2 -2
modules/database/backUp/database.py
CHANGED
|
@@ -57,7 +57,7 @@ def store_chat_history_v3(username, messages, analysis_type):
|
|
| 57 |
|
| 58 |
chat_document = {
|
| 59 |
'username': username,
|
| 60 |
-
'timestamp': datetime.now(timezone.utc)
|
| 61 |
'analysis_type': analysis_type,
|
| 62 |
'messages': messages
|
| 63 |
}
|
|
@@ -141,7 +141,7 @@ def store_morphosyntax_result(username, text, repeated_words, arc_diagrams, pos_
|
|
| 141 |
|
| 142 |
analysis_document = {
|
| 143 |
'username': username,
|
| 144 |
-
'timestamp': datetime.now(timezone.utc)
|
| 145 |
'text': text,
|
| 146 |
'repeated_words': repeated_words,
|
| 147 |
'word_count': word_count,
|
|
|
|
| 57 |
|
| 58 |
chat_document = {
|
| 59 |
'username': username,
|
| 60 |
+
'timestamp': datetime.now(timezone.utc) # Mejor práctica
|
| 61 |
'analysis_type': analysis_type,
|
| 62 |
'messages': messages
|
| 63 |
}
|
|
|
|
| 141 |
|
| 142 |
analysis_document = {
|
| 143 |
'username': username,
|
| 144 |
+
'timestamp': datetime.now(timezone.utc) # Mejor práctica
|
| 145 |
'text': text,
|
| 146 |
'repeated_words': repeated_words,
|
| 147 |
'word_count': word_count,
|
modules/database/chat_mongo_db.py
CHANGED
|
@@ -113,7 +113,7 @@ def store_chat_history(username: str, messages: list, analysis_type: str = 'side
|
|
| 113 |
|
| 114 |
chat_document = {
|
| 115 |
'username': username,
|
| 116 |
-
'timestamp': datetime.now(timezone.utc)
|
| 117 |
'messages': formatted_messages,
|
| 118 |
'analysis_type': analysis_type,
|
| 119 |
'metadata': metadata or {}
|
|
|
|
| 113 |
|
| 114 |
chat_document = {
|
| 115 |
'username': username,
|
| 116 |
+
'timestamp': datetime.now(timezone.utc) # Mejor práctica
|
| 117 |
'messages': formatted_messages,
|
| 118 |
'analysis_type': analysis_type,
|
| 119 |
'metadata': metadata or {}
|
modules/database/claude_recommendations_mongo_db.py
CHANGED
|
@@ -34,7 +34,7 @@ def store_claude_recommendation(username, text, metrics, text_type, recommendati
|
|
| 34 |
# Crear documento
|
| 35 |
document = {
|
| 36 |
'username': username,
|
| 37 |
-
'timestamp': datetime.now(timezone.utc)
|
| 38 |
'text': text,
|
| 39 |
'metrics': metrics or {},
|
| 40 |
'text_type': text_type,
|
|
|
|
| 34 |
# Crear documento
|
| 35 |
document = {
|
| 36 |
'username': username,
|
| 37 |
+
'timestamp': datetime.now(timezone.utc) # Mejor práctica
|
| 38 |
'text': text,
|
| 39 |
'metrics': metrics or {},
|
| 40 |
'text_type': text_type,
|
modules/database/current_situation_mongo_db.py
CHANGED
|
@@ -26,7 +26,7 @@ def store_current_situation_result(username, text, metrics, feedback):
|
|
| 26 |
# Crear documento
|
| 27 |
document = {
|
| 28 |
'username': username,
|
| 29 |
-
'timestamp': datetime.now(timezone.utc)
|
| 30 |
'text': text,
|
| 31 |
'metrics': metrics,
|
| 32 |
'feedback': feedback or {},
|
|
|
|
| 26 |
# Crear documento
|
| 27 |
document = {
|
| 28 |
'username': username,
|
| 29 |
+
'timestamp': datetime.now(timezone.utc) # Mejor práctica
|
| 30 |
'text': text,
|
| 31 |
'metrics': metrics,
|
| 32 |
'feedback': feedback or {},
|
modules/database/discourse_mongo_db.py
CHANGED
|
@@ -25,7 +25,7 @@ def store_student_discourse_result(username, text1, text2, analysis_result):
|
|
| 25 |
# Preparar el documento para MongoDB
|
| 26 |
document = {
|
| 27 |
'username': username,
|
| 28 |
-
'timestamp': datetime.now(timezone.utc)
|
| 29 |
'text1': text1,
|
| 30 |
'text2': text2,
|
| 31 |
'key_concepts1': analysis_result.get('key_concepts1', []),
|
|
|
|
| 25 |
# Preparar el documento para MongoDB
|
| 26 |
document = {
|
| 27 |
'username': username,
|
| 28 |
+
'timestamp': datetime.now(timezone.utc) # Mejor práctica
|
| 29 |
'text1': text1,
|
| 30 |
'text2': text2,
|
| 31 |
'key_concepts1': analysis_result.get('key_concepts1', []),
|
modules/database/morphosintax_mongo_db.py
CHANGED
|
@@ -11,7 +11,7 @@ COLLECTION_NAME = 'student_morphosyntax_analysis'
|
|
| 11 |
def store_student_morphosyntax_result(username, text, arc_diagrams):
|
| 12 |
analysis_document = {
|
| 13 |
'username': username,
|
| 14 |
-
'timestamp': datetime.now(timezone.utc)
|
| 15 |
'text': text,
|
| 16 |
'arc_diagrams': arc_diagrams,
|
| 17 |
'analysis_type': 'morphosyntax'
|
|
|
|
| 11 |
def store_student_morphosyntax_result(username, text, arc_diagrams):
|
| 12 |
analysis_document = {
|
| 13 |
'username': username,
|
| 14 |
+
'timestamp': datetime.now(timezone.utc) # Mejor práctica
|
| 15 |
'text': text,
|
| 16 |
'arc_diagrams': arc_diagrams,
|
| 17 |
'analysis_type': 'morphosyntax'
|
modules/database/morphosyntax_iterative_mongo_db.py
CHANGED
|
@@ -16,7 +16,7 @@ def store_student_morphosyntax_base(username, text, arc_diagrams):
|
|
| 16 |
try:
|
| 17 |
base_document = {
|
| 18 |
'username': username,
|
| 19 |
-
'timestamp': datetime.now(timezone.utc)
|
| 20 |
'text': text,
|
| 21 |
'arc_diagrams': arc_diagrams,
|
| 22 |
'analysis_type': 'morphosyntax_base',
|
|
@@ -46,7 +46,7 @@ def store_student_morphosyntax_iteration(username, base_id, original_text, itera
|
|
| 46 |
iteration_document = {
|
| 47 |
'username': username,
|
| 48 |
'base_id': base_id, # Guardar el ObjectId en la iteración
|
| 49 |
-
'timestamp': datetime.now(timezone.utc)
|
| 50 |
'original_text': original_text,
|
| 51 |
'iteration_text': iteration_text,
|
| 52 |
'arc_diagrams': arc_diagrams,
|
|
|
|
| 16 |
try:
|
| 17 |
base_document = {
|
| 18 |
'username': username,
|
| 19 |
+
'timestamp': datetime.now(timezone.utc) # Mejor práctica
|
| 20 |
'text': text,
|
| 21 |
'arc_diagrams': arc_diagrams,
|
| 22 |
'analysis_type': 'morphosyntax_base',
|
|
|
|
| 46 |
iteration_document = {
|
| 47 |
'username': username,
|
| 48 |
'base_id': base_id, # Guardar el ObjectId en la iteración
|
| 49 |
+
'timestamp': datetime.now(timezone.utc) # Mejor práctica
|
| 50 |
'original_text': original_text,
|
| 51 |
'iteration_text': iteration_text,
|
| 52 |
'arc_diagrams': arc_diagrams,
|
modules/database/semantic_mongo_db.py
CHANGED
|
@@ -53,7 +53,7 @@ def store_student_semantic_result(username, text, analysis_result, lang_code='en
|
|
| 53 |
# Crear documento para MongoDB
|
| 54 |
analysis_document = {
|
| 55 |
'username': username,
|
| 56 |
-
'timestamp': datetime.now(timezone.utc)
|
| 57 |
'text': text,
|
| 58 |
'analysis_type': 'semantic',
|
| 59 |
'key_concepts': analysis_result.get('key_concepts', []),
|
|
|
|
| 53 |
# Crear documento para MongoDB
|
| 54 |
analysis_document = {
|
| 55 |
'username': username,
|
| 56 |
+
'timestamp': datetime.now(timezone.utc) # Mejor práctica
|
| 57 |
'text': text,
|
| 58 |
'analysis_type': 'semantic',
|
| 59 |
'key_concepts': analysis_result.get('key_concepts', []),
|
modules/database/semantic_mongo_live_db.py
CHANGED
|
@@ -47,7 +47,7 @@ def store_student_semantic_live_result(username, text, analysis_result, lang_cod
|
|
| 47 |
# 3. Preparar documento (CORREGIDO)
|
| 48 |
analysis_document = {
|
| 49 |
'username': username,
|
| 50 |
-
'timestamp': datetime.now(timezone.utc)
|
| 51 |
'text': text[:50000],
|
| 52 |
'analysis_type': 'semantic_live',
|
| 53 |
'language': lang_code,
|
|
|
|
| 47 |
# 3. Preparar documento (CORREGIDO)
|
| 48 |
analysis_document = {
|
| 49 |
'username': username,
|
| 50 |
+
'timestamp': datetime.now(timezone.utc) # Mejor práctica
|
| 51 |
'text': text[:50000],
|
| 52 |
'analysis_type': 'semantic_live',
|
| 53 |
'language': lang_code,
|
modules/database/sql_db.py
CHANGED
|
@@ -50,7 +50,7 @@ def create_user(username, password, role, additional_info=None):
|
|
| 50 |
'id': username,
|
| 51 |
'password': password,
|
| 52 |
'role': role,
|
| 53 |
-
'timestamp': datetime.now(timezone.utc)
|
| 54 |
'additional_info': additional_info or {},
|
| 55 |
'partitionKey': username # Agregar partition key
|
| 56 |
}
|
|
|
|
| 50 |
'id': username,
|
| 51 |
'password': password,
|
| 52 |
'role': role,
|
| 53 |
+
'timestamp': datetime.now(timezone.utc) # Mejor práctica
|
| 54 |
'additional_info': additional_info or {},
|
| 55 |
'partitionKey': username # Agregar partition key
|
| 56 |
}
|
modules/database/writing_progress_mongo_db.py
CHANGED
|
@@ -21,7 +21,7 @@ def store_writing_baseline(username, metrics, text):
|
|
| 21 |
'type': 'baseline',
|
| 22 |
'metrics': metrics,
|
| 23 |
'text': text,
|
| 24 |
-
'timestamp': datetime.now(timezone.utc)
|
| 25 |
'iteration': 0 # Línea base siempre es iteración 0
|
| 26 |
}
|
| 27 |
|
|
@@ -70,7 +70,7 @@ def store_writing_progress(username, metrics, text):
|
|
| 70 |
'type': 'progress',
|
| 71 |
'metrics': metrics,
|
| 72 |
'text': text,
|
| 73 |
-
'timestamp': datetime.now(timezone.utc)
|
| 74 |
'iteration': next_iteration
|
| 75 |
}
|
| 76 |
|
|
|
|
| 21 |
'type': 'baseline',
|
| 22 |
'metrics': metrics,
|
| 23 |
'text': text,
|
| 24 |
+
'timestamp': datetime.now(timezone.utc) # Mejor práctica
|
| 25 |
'iteration': 0 # Línea base siempre es iteración 0
|
| 26 |
}
|
| 27 |
|
|
|
|
| 70 |
'type': 'progress',
|
| 71 |
'metrics': metrics,
|
| 72 |
'text': text,
|
| 73 |
+
'timestamp': datetime.now(timezone.utc) # Mejor práctica
|
| 74 |
'iteration': next_iteration
|
| 75 |
}
|
| 76 |
|