@@ -258,7 +258,7 @@ def _run_submission_real(self, sub, args, timelim_low, timelim_high):
258
258
res1 = res2
259
259
elif res2 .validator_first and res2 .verdict == 'WA' :
260
260
# WA can override TLE for interactive problems (see comment in validate_interactive).
261
- res1 = SubmissionResult ('WA' , score = res2 . score )
261
+ res1 = SubmissionResult ('WA' )
262
262
res1 .validator_first = True
263
263
res2 .runtime = timelim_low
264
264
else :
@@ -1021,18 +1021,18 @@ def grade(self, sub_results, testcasegroup, shadow_result=False):
1021
1021
if not os .WIFEXITED (status ):
1022
1022
self .error ('Judge error: %s crashed' % grader )
1023
1023
self .debug ('Grader input:\n %s' % grader_input )
1024
- return ('JE' , 0.0 )
1024
+ return ('JE' , None )
1025
1025
ret = os .WEXITSTATUS (status )
1026
1026
if ret != 0 :
1027
1027
self .error ('Judge error: exit code %d for grader %s, expected 0' % (ret , grader ))
1028
1028
self .debug ('Grader input: %s\n ' % grader_input )
1029
- return SubmissionResult ('JE' , 0.0 )
1029
+ return ('JE' , None )
1030
1030
1031
1031
if not re .match (grader_output_re , grader_output ):
1032
1032
self .error ('Judge error: invalid format of grader output' )
1033
1033
self .debug ('Output must match: "%s"' % grader_output_re )
1034
1034
self .debug ('Output was: "%s"' % grader_output )
1035
- return ('JE' , 0.0 )
1035
+ return ('JE' , None )
1036
1036
1037
1037
verdict , score = grader_output .split ()
1038
1038
score = float (score )
@@ -1131,15 +1131,6 @@ def _parse_validator_results(self, val, status, feedbackdir, testcase):
1131
1131
score_file = os .path .join (feedbackdir , 'score.txt' )
1132
1132
if not custom_score and os .path .isfile (score_file ):
1133
1133
return SubmissionResult ('JE' , reason = 'validator produced "score.txt" but problem does not have custom scoring activated' )
1134
- if custom_score :
1135
- if os .path .isfile (score_file ):
1136
- try :
1137
- score_str = open (score_file ).read ()
1138
- score = float (score_str )
1139
- except Exception as e :
1140
- return SubmissionResult ('JE' , reason = 'failed to parse validator score: %s' % e )
1141
- else :
1142
- return SubmissionResult ('JE' , reason = 'problem has custom scoring but validator did not produce "score.txt"' )
1143
1134
1144
1135
if not os .WIFEXITED (status ):
1145
1136
return SubmissionResult ('JE' ,
@@ -1152,8 +1143,18 @@ def _parse_validator_results(self, val, status, feedbackdir, testcase):
1152
1143
additional_info = OutputValidators .__get_feedback (feedbackdir ))
1153
1144
1154
1145
if ret == 43 :
1155
- return SubmissionResult ('WA' , score = score ,
1156
- additional_info = OutputValidators .__get_feedback (feedbackdir ))
1146
+ return SubmissionResult ('WA' , additional_info = OutputValidators .__get_feedback (feedbackdir ))
1147
+
1148
+ if custom_score :
1149
+ if os .path .isfile (score_file ):
1150
+ try :
1151
+ score_str = open (score_file ).read ()
1152
+ score = float (score_str )
1153
+ except Exception as e :
1154
+ return SubmissionResult ('JE' , reason = 'failed to parse validator score: %s' % e )
1155
+ else :
1156
+ return SubmissionResult ('JE' , reason = 'problem has custom scoring but validator did not produce "score.txt"' )
1157
+
1157
1158
return SubmissionResult ('AC' , score = score )
1158
1159
1159
1160
0 commit comments