xiomarablanco commited on
Commit
a246d29
1 Parent(s): 28fb4c5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -17,7 +17,7 @@ def Main(uploadedFile, txtFileInput, orthographyPercentage, syntaxPercentage, se
17
  error = ""
18
  excelPath = None
19
 
20
- copySpanishDictionaries()
21
 
22
  try:
23
  if not txtFileInput:
@@ -74,7 +74,7 @@ def Main(uploadedFile, txtFileInput, orthographyPercentage, syntaxPercentage, se
74
  return [error, excelPath]
75
 
76
  try:
77
- print("Processing!")
78
  modelResult = response.processApiData()
79
  except Exception as ex:
80
  error = "Error processing: " + str(ex)
@@ -103,7 +103,8 @@ def exportResultToExcelFile(modelResult, outputFilePath):
103
  index+= 1
104
 
105
  #tableResults = tablib.Dataset(headers=('ID', 'SimilitudSpacy', 'SimilitudBert', 'NotaSemanticaSpacy', 'NotaSemanticaBert', 'NotaSintaxis', 'NotaOrtografia','NotaTotalSpacy','NotaTotalBert','Feedback'))
106
- tableResults = tablib.Dataset(headers=('ID', 'SumaTotalSpacy', 'SumaTotaldBert', 'NotaSemanticaSpacy', 'NotaSemanticaBert', 'NotaSintaxis', 'NotaOrtografia','NotaTotalSpacy','NotaTotalBert','Feedback'))
 
107
 
108
  tableResults.json=json.dumps(excelData)
109
  tableExport=tableResults.export('xlsx')
@@ -250,7 +251,7 @@ def answersTodict(zip_path):
250
  student_name = student.split("(")
251
  student_name = student_name[0]
252
 
253
- print("student: " + str(student) + " - index: " + str(indx))
254
 
255
  try:
256
  #opening the file
@@ -262,7 +263,7 @@ def answersTodict(zip_path):
262
 
263
 
264
  if os.path.exists(fichero1):
265
- print("Fichero: "+str(fichero1))
266
  #fichero = open(create_file_path("StudentAnswers/" + work_folder + "/" + student + "/" + 'Adjuntos del envio/Respuesta enviada', doctype= 1), encoding='utf-8')
267
  #fichero = create_file_path("StudentAnswers/" + work_folder + "/" + student + "/" + 'Adjuntos del envio/Respuesta enviada', doctype= 1)
268
  #if os.path.exists(fichero):
@@ -270,7 +271,7 @@ def answersTodict(zip_path):
270
  #else:
271
  fichero = open(create_file_path("StudentAnswers/" + work_folder + "/" + student + "/" + student+'_submissionText.html', doctype= 1), encoding='utf-8')
272
 
273
- print("fichero abierto")
274
  #reading it
275
  lineas = fichero.readlines()
276
 
@@ -279,14 +280,14 @@ def answersTodict(zip_path):
279
  if (len(lineas) > 0):
280
  textoFichero = lineas[0]
281
 
282
- print("texto: " + textoFichero)
283
 
284
  #removing html
285
  textoFichero = removeHtmlFromString(textoFichero)
286
 
287
  #saving it
288
  studentAnswersDict.append({"respuesta":textoFichero, "hashed_id":student_name, "TableIndex":indx})
289
- print("fichero procesado")
290
 
291
  elif os.path.exists(create_file_path("StudentAnswers/" + work_folder, doctype= 1)) :
292
  #print("Entra por acá2")
 
17
  error = ""
18
  excelPath = None
19
 
20
+ #copySpanishDictionaries()
21
 
22
  try:
23
  if not txtFileInput:
 
74
  return [error, excelPath]
75
 
76
  try:
77
+ #print("Processing!")
78
  modelResult = response.processApiData()
79
  except Exception as ex:
80
  error = "Error processing: " + str(ex)
 
103
  index+= 1
104
 
105
  #tableResults = tablib.Dataset(headers=('ID', 'SimilitudSpacy', 'SimilitudBert', 'NotaSemanticaSpacy', 'NotaSemanticaBert', 'NotaSintaxis', 'NotaOrtografia','NotaTotalSpacy','NotaTotalBert','Feedback'))
106
+ #tableResults = tablib.Dataset(headers=('ID', 'SumaTotalSpacy', 'SumaTotaldBert', 'NotaSemanticaSpacy', 'NotaSemanticaBert', 'NotaSintaxis', 'NotaOrtografia','NotaTotalSpacy','NotaTotalBert','Feedback'))
107
+ tableResults = tablib.Dataset(headers=('ID', 'RespuestaAlumno', 'NotaSemanticaSpacy', 'NotaSemanticaBert', 'NotaSintaxis', 'NotaOrtografia','NotaTotalSpacy','NotaTotalBert','Feedback'))
108
 
109
  tableResults.json=json.dumps(excelData)
110
  tableExport=tableResults.export('xlsx')
 
251
  student_name = student.split("(")
252
  student_name = student_name[0]
253
 
254
+ #print("student: " + str(student) + " - index: " + str(indx))
255
 
256
  try:
257
  #opening the file
 
263
 
264
 
265
  if os.path.exists(fichero1):
266
+ #print("Fichero: "+str(fichero1))
267
  #fichero = open(create_file_path("StudentAnswers/" + work_folder + "/" + student + "/" + 'Adjuntos del envio/Respuesta enviada', doctype= 1), encoding='utf-8')
268
  #fichero = create_file_path("StudentAnswers/" + work_folder + "/" + student + "/" + 'Adjuntos del envio/Respuesta enviada', doctype= 1)
269
  #if os.path.exists(fichero):
 
271
  #else:
272
  fichero = open(create_file_path("StudentAnswers/" + work_folder + "/" + student + "/" + student+'_submissionText.html', doctype= 1), encoding='utf-8')
273
 
274
+ #print("fichero abierto")
275
  #reading it
276
  lineas = fichero.readlines()
277
 
 
280
  if (len(lineas) > 0):
281
  textoFichero = lineas[0]
282
 
283
+ #print("texto: " + textoFichero)
284
 
285
  #removing html
286
  textoFichero = removeHtmlFromString(textoFichero)
287
 
288
  #saving it
289
  studentAnswersDict.append({"respuesta":textoFichero, "hashed_id":student_name, "TableIndex":indx})
290
+ #print("fichero procesado")
291
 
292
  elif os.path.exists(create_file_path("StudentAnswers/" + work_folder, doctype= 1)) :
293
  #print("Entra por acá2")