Blanca commited on
Commit
94c072e
·
verified ·
1 Parent(s): 5611f39

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -92,8 +92,8 @@ def add_new_eval(
92
  if len(user_submission_dates) > 0 and user_submission_dates[-1] == datetime.datetime.today().strftime('%Y-%m-%d'):
93
  return format_error("You already submitted once today, please try again tomorrow.")
94
 
95
-
96
- is_validation = val_or_test == "validation"
97
  # Very basic email parsing
98
  _, parsed_mail = parseaddr(mail)
99
  if not "@" in parsed_mail:
@@ -214,11 +214,11 @@ def add_new_eval(
214
  #"score_level3": scores[3]/num_questions[3],
215
  "date": datetime.datetime.today().strftime('%Y-%m-%d')
216
  }
217
- if num_questions[1] + num_questions[2] + num_questions[3] != ref_scores_len[val_or_test]:
218
- return format_error(f"Your submission has {len(scores['all'])} questions for the {val_or_test} set, but it should have {ref_scores_len[val_or_test]}. Please check your submission.")
219
  # Catching spam submissions of 100%
220
- if all((eval_entry[k] == 1 for k in ["score_level1", "score_level2", "score_level3"])):
221
- return format_error(f"There was a problem with your submission. Please open a discussion.")
222
 
223
  # Testing for duplicates - to see if we want to add something like it as it would allow people to try to see the content of other submissions
224
  #eval_entry_no_date = {k: v for k, v in eval_entry if k != "date"}
 
92
  if len(user_submission_dates) > 0 and user_submission_dates[-1] == datetime.datetime.today().strftime('%Y-%m-%d'):
93
  return format_error("You already submitted once today, please try again tomorrow.")
94
 
95
+ val_or_test = "test"
96
+ is_validation = False
97
  # Very basic email parsing
98
  _, parsed_mail = parseaddr(mail)
99
  if not "@" in parsed_mail:
 
214
  #"score_level3": scores[3]/num_questions[3],
215
  "date": datetime.datetime.today().strftime('%Y-%m-%d')
216
  }
217
+ #if num_questions[1] + num_questions[2] + num_questions[3] != ref_scores_len[val_or_test]:
218
+ # return format_error(f"Your submission has {len(scores['all'])} questions for the {val_or_test} set, but it should have {ref_scores_len[val_or_test]}. Please check your submission.")
219
  # Catching spam submissions of 100%
220
+ #if all((eval_entry[k] == 1 for k in ["score_level1", "score_level2", "score_level3"])):
221
+ # return format_error(f"There was a problem with your submission. Please open a discussion.")
222
 
223
  # Testing for duplicates - to see if we want to add something like it as it would allow people to try to see the content of other submissions
224
  #eval_entry_no_date = {k: v for k, v in eval_entry if k != "date"}