AIdeaText commited on
Commit
7e75701
verified
1 Parent(s): 4afb220

Update modules/studentact/current_situation_interface.py

Browse files
modules/studentact/current_situation_interface.py CHANGED
@@ -105,7 +105,8 @@ def display_current_situation_interface(lang_code, nlp_models, t):
105
  st.session_state.current_metrics = None
106
  if 'current_recommendations' not in st.session_state:
107
  st.session_state.current_recommendations = None
108
-
 
109
  try:
110
  # Container principal con dos columnas
111
  with st.container():
@@ -114,11 +115,11 @@ def display_current_situation_interface(lang_code, nlp_models, t):
114
  with input_col:
115
  # Text area con manejo de estado
116
  text_input = st.text_area(
117
- current_situation_t.get('input_prompt', "Escribe o pega tu texto aqu铆:"),
118
  height=400,
119
- key=f"text_area_{lang_code}", # Clave 煤nica por idioma
120
  value=st.session_state.text_input,
121
- help=current_situation_t.get('help', "Este texto ser谩 analizado para darte recomendaciones personalizadas")
122
  )
123
 
124
  # Funci贸n para manejar cambios de texto
@@ -127,13 +128,13 @@ def display_current_situation_interface(lang_code, nlp_models, t):
127
  st.session_state.show_results = False
128
 
129
  if st.button(
130
- current_situation_t.get('first_analyze_button', "Analizar mi escritura"),
131
  type="primary",
132
  disabled=not text_input.strip(),
133
  use_container_width=True,
134
  ):
135
  try:
136
- with st.spinner(current_situation_t.get('processing', "Analizando...")):
137
  doc = nlp_models[lang_code](text_input)
138
  metrics = analyze_text_dimensions(doc)
139
 
@@ -153,7 +154,8 @@ def display_current_situation_interface(lang_code, nlp_models, t):
153
 
154
  except Exception as e:
155
  logger.error(f"Error en an谩lisis: {str(e)}")
156
- st.error(current_situation_t.get('analysis_error', "Error al analizar el texto"))
 
157
 
158
  # Mostrar resultados en la columna derecha
159
  with results_col:
 
105
  st.session_state.current_metrics = None
106
  if 'current_recommendations' not in st.session_state:
107
  st.session_state.current_recommendations = None
108
+ ####################################################################################
109
+ ####################################################################################
110
  try:
111
  # Container principal con dos columnas
112
  with st.container():
 
115
  with input_col:
116
  # Text area con manejo de estado
117
  text_input = st.text_area(
118
+ t.get('input_prompt', "Escribe o pega tu texto aqu铆:"),
119
  height=400,
120
+ key="text_area",
121
  value=st.session_state.text_input,
122
+ help="Este texto ser谩 analizado para darte recomendaciones personalizadas"
123
  )
124
 
125
  # Funci贸n para manejar cambios de texto
 
128
  st.session_state.show_results = False
129
 
130
  if st.button(
131
+ t.get('analyze_button', "Analizar mi escritura"),
132
  type="primary",
133
  disabled=not text_input.strip(),
134
  use_container_width=True,
135
  ):
136
  try:
137
+ with st.spinner(t.get('processing', "Analizando...")):
138
  doc = nlp_models[lang_code](text_input)
139
  metrics = analyze_text_dimensions(doc)
140
 
 
154
 
155
  except Exception as e:
156
  logger.error(f"Error en an谩lisis: {str(e)}")
157
+ st.error(t.get('analysis_error', "Error al analizar el texto"))
158
+ #######################################################################################################
159
 
160
  # Mostrar resultados en la columna derecha
161
  with results_col: