Update modules/studentact/current_situation_interface.py
Browse files
modules/studentact/current_situation_interface.py
CHANGED
@@ -73,6 +73,8 @@ TEXT_TYPES = {
|
|
73 |
}
|
74 |
}
|
75 |
|
|
|
|
|
76 |
def display_current_situation_interface(lang_code, nlp_models, t):
|
77 |
"""
|
78 |
Interfaz simplificada con gráfico de radar para visualizar métricas.
|
@@ -220,6 +222,46 @@ def display_diagnosis(metrics, text_type=None, lang_code='es', t=None):
|
|
220 |
# Asegurar que tenemos traducciones
|
221 |
if t is None:
|
222 |
t = {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
223 |
|
224 |
# Usar valor por defecto si no se especifica tipo
|
225 |
text_type = text_type or 'student_essay'
|
|
|
73 |
}
|
74 |
}
|
75 |
|
76 |
+
####################################################
|
77 |
+
####################################################
|
78 |
def display_current_situation_interface(lang_code, nlp_models, t):
|
79 |
"""
|
80 |
Interfaz simplificada con gráfico de radar para visualizar métricas.
|
|
|
222 |
# Asegurar que tenemos traducciones
|
223 |
if t is None:
|
224 |
t = {}
|
225 |
+
|
226 |
+
# Traducciones para títulos y etiquetas
|
227 |
+
dimension_labels = {
|
228 |
+
'es': {
|
229 |
+
'title': "Tipo de texto",
|
230 |
+
'vocabulary': "Vocabulario",
|
231 |
+
'structure': "Estructura",
|
232 |
+
'cohesion': "Cohesión",
|
233 |
+
'clarity': "Claridad",
|
234 |
+
'improvement': "⚠️ Por mejorar",
|
235 |
+
'acceptable': "📈 Aceptable",
|
236 |
+
'optimal': "✅ Óptimo",
|
237 |
+
'target': "Meta: {:.2f}"
|
238 |
+
},
|
239 |
+
'en': {
|
240 |
+
'title': "Text Type",
|
241 |
+
'vocabulary': "Vocabulary",
|
242 |
+
'structure': "Structure",
|
243 |
+
'cohesion': "Cohesion",
|
244 |
+
'clarity': "Clarity",
|
245 |
+
'improvement': "⚠️ Needs improvement",
|
246 |
+
'acceptable': "📈 Acceptable",
|
247 |
+
'optimal': "✅ Optimal",
|
248 |
+
'target': "Target: {:.2f}"
|
249 |
+
},
|
250 |
+
'uk': {
|
251 |
+
'title': "Тип тексту",
|
252 |
+
'vocabulary': "Словниковий запас",
|
253 |
+
'structure': "Структура",
|
254 |
+
'cohesion': "Зв'язність",
|
255 |
+
'clarity': "Ясність",
|
256 |
+
'improvement': "⚠️ Потребує покращення",
|
257 |
+
'acceptable': "📈 Прийнятно",
|
258 |
+
'optimal': "✅ Оптимально",
|
259 |
+
'target': "Ціль: {:.2f}"
|
260 |
+
}
|
261 |
+
}
|
262 |
+
|
263 |
+
# Obtener traducciones para el idioma actual, con fallback a español
|
264 |
+
labels = dimension_labels.get(lang_code, dimension_labels['es'])
|
265 |
|
266 |
# Usar valor por defecto si no se especifica tipo
|
267 |
text_type = text_type or 'student_essay'
|