@@ -258,7 +258,7 @@ def _run_submission_real(self, sub, args, timelim_low, timelim_high):
258258 res1 = res2
259259 elif res2 .validator_first and res2 .verdict == 'WA' :
260260 # WA can override TLE for interactive problems (see comment in validate_interactive).
261- res1 = SubmissionResult ('WA' , score = res2 . score )
261+ res1 = SubmissionResult ('WA' )
262262 res1 .validator_first = True
263263 res2 .runtime = timelim_low
264264 else :
@@ -1021,18 +1021,18 @@ def grade(self, sub_results, testcasegroup, shadow_result=False):
10211021 if not os .WIFEXITED (status ):
10221022 self .error ('Judge error: %s crashed' % grader )
10231023 self .debug ('Grader input:\n %s' % grader_input )
1024- return ('JE' , 0.0 )
1024+ return ('JE' , None )
10251025 ret = os .WEXITSTATUS (status )
10261026 if ret != 0 :
10271027 self .error ('Judge error: exit code %d for grader %s, expected 0' % (ret , grader ))
10281028 self .debug ('Grader input: %s\n ' % grader_input )
1029- return SubmissionResult ('JE' , 0.0 )
1029+ return ('JE' , None )
10301030
10311031 if not re .match (grader_output_re , grader_output ):
10321032 self .error ('Judge error: invalid format of grader output' )
10331033 self .debug ('Output must match: "%s"' % grader_output_re )
10341034 self .debug ('Output was: "%s"' % grader_output )
1035- return ('JE' , 0.0 )
1035+ return ('JE' , None )
10361036
10371037 verdict , score = grader_output .split ()
10381038 score = float (score )
@@ -1131,15 +1131,6 @@ def _parse_validator_results(self, val, status, feedbackdir, testcase):
11311131 score_file = os .path .join (feedbackdir , 'score.txt' )
11321132 if not custom_score and os .path .isfile (score_file ):
11331133 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"' )
11431134
11441135 if not os .WIFEXITED (status ):
11451136 return SubmissionResult ('JE' ,
@@ -1152,8 +1143,18 @@ def _parse_validator_results(self, val, status, feedbackdir, testcase):
11521143 additional_info = OutputValidators .__get_feedback (feedbackdir ))
11531144
11541145 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+
11571158 return SubmissionResult ('AC' , score = score )
11581159
11591160
0 commit comments