xiomarablanco commited on
Commit
10a6928
1 Parent(s): 89c0393

EliminarCaracteres

Browse files
Files changed (1) hide show
  1. app.py +16 -2
app.py CHANGED
@@ -306,11 +306,25 @@ def answersTodict(zip_path):
306
  lineas = fichero.readlines()
307
 
308
  #removing html
309
- lineas[0] = removeHtmlFromString(lineas[0])
 
 
 
 
 
 
 
 
 
 
 
 
 
 
310
 
311
  #saving it
312
  indx2+=1
313
- studentAnswersDict.append({"respuesta":lineas[0], "hashed_id":student_name, "TableIndex":indx2})
314
  #break
315
  #elif student_response!='file' or None:
316
  # print("Fichero no encontrado")
 
306
  lineas = fichero.readlines()
307
 
308
  #removing html
309
+ #lineas[0] = removeHtmlFromString(lineas[0])
310
+ textoFichero=""
311
+
312
+ #removing html
313
+ if (len(lineas) > 0):
314
+ string_without_line_breaks = ""
315
+ for line in lineas:
316
+ stripped_line = line.rstrip()
317
+ string_without_line_breaks += stripped_line
318
+ textoFichero = string_without_line_breaks
319
+ #textoFichero = lineas[0]
320
+
321
+ #lineas[0] = removeHtmlFromString(lineas[0])
322
+ textoFichero = removeHtmlFromString(str(textoFichero.encode("utf-8")))
323
+ #print(textoFichero)
324
 
325
  #saving it
326
  indx2+=1
327
+ studentAnswersDict.append({"respuesta":textoFichero, "hashed_id":student_name, "TableIndex":indx2})
328
  #break
329
  #elif student_response!='file' or None:
330
  # print("Fichero no encontrado")