Description:
[grader] change messages
git-svn-id: http://theory.cpe.ku.ac.th/grader/judge/trunk/scripts@242 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r58:b32b8de97eae - - 1 file changed: 8 inserted, 2 deleted
@@ -78,40 +78,46 | |||||
|
78 | end |
|
78 | end |
|
79 |
|
79 | ||
|
80 | return {:points => result, |
|
80 | return {:points => result, |
|
81 | :comment => comment, |
|
81 | :comment => comment, |
|
82 | :cmp_msg => cmp_msg} |
|
82 | :cmp_msg => cmp_msg} |
|
83 | else |
|
83 | else |
|
84 | if FileTest.exist?("#{test_result_dir}/a.out") |
|
84 | if FileTest.exist?("#{test_result_dir}/a.out") |
|
85 | return {:points => 0, |
|
85 | return {:points => 0, |
|
86 | :comment => 'error during grading', |
|
86 | :comment => 'error during grading', |
|
87 | :cmp_msg => cmp_msg} |
|
87 | :cmp_msg => cmp_msg} |
|
88 | else |
|
88 | else |
|
89 | return {:points => 0, |
|
89 | return {:points => 0, |
|
90 | :comment => 'compilation error', |
|
90 | :comment => 'compilation error', |
|
91 | :cmp_msg => cmp_msg} |
|
91 | :cmp_msg => cmp_msg} |
|
92 | end |
|
92 | end |
|
93 | end |
|
93 | end |
|
94 | end |
|
94 | end |
|
95 |
|
95 | ||
|
96 | def save_result(submission,result) |
|
96 | def save_result(submission,result) |
|
97 | problem = submission.problem |
|
97 | problem = submission.problem |
|
98 | submission.graded_at = Time.now.gmtime |
|
98 | submission.graded_at = Time.now.gmtime |
|
99 | points = result[:points] |
|
99 | points = result[:points] |
|
100 | submission.points = points |
|
100 | submission.points = points |
|
101 | comment = @config.report_comment(result[:comment]) |
|
101 | comment = @config.report_comment(result[:comment]) |
|
|
102 | + | ||
|
|
103 | + # | ||
|
|
104 | + # TODO: FIX THIS MESSAGE | ||
|
|
105 | + # | ||
|
102 | if problem == nil |
|
106 | if problem == nil |
|
103 | submission.grader_comment = 'PASSED: ' + comment + '(problem is nil)' |
|
107 | submission.grader_comment = 'PASSED: ' + comment + '(problem is nil)' |
|
104 | elsif points == problem.full_score |
|
108 | elsif points == problem.full_score |
|
105 | - submission.grader_comment = 'PASSED: ' + comment |
|
109 | + #submission.grader_comment = 'PASSED: ' + comment |
|
|
110 | + submission.grader_comment = comment | ||
|
106 | elsif result[:comment].chomp =~ /^[\[\]P]+$/ |
|
111 | elsif result[:comment].chomp =~ /^[\[\]P]+$/ |
|
107 | submission.grader_comment = 'PASSED: ' + comment + '(inconsistent score)' |
|
112 | submission.grader_comment = 'PASSED: ' + comment + '(inconsistent score)' |
|
108 | else |
|
113 | else |
|
109 | - submission.grader_comment = 'FAILED: ' + comment |
|
114 | + #submission.grader_comment = 'FAILED: ' + comment |
|
|
115 | + submission.grader_comment = comment | ||
|
110 | end |
|
116 | end |
|
111 | submission.compiler_message = result[:cmp_msg] or '' |
|
117 | submission.compiler_message = result[:cmp_msg] or '' |
|
112 | submission.save |
|
118 | submission.save |
|
113 | end |
|
119 | end |
|
114 |
|
120 | ||
|
115 | end |
|
121 | end |
|
116 |
|
122 | ||
|
117 | end |
|
123 | end |
You need to be logged in to leave comments.
Login now