diff --git a/lib/configuration.rb b/lib/configuration.rb --- a/lib/configuration.rb +++ b/lib/configuration.rb @@ -42,8 +42,10 @@ def report_comment(comment) case comment_report_style when :short - if comment.chomp =~ /^P+$/ # all P's + if comment.chomp =~ /^[\[\]P]+$/ # all P's 'passed' + elsif comment.chomp =~ /[Cc]ompil.*[Ee]rror/ + 'compilation error' else 'failed' end diff --git a/lib/submission_helper.rb b/lib/submission_helper.rb --- a/lib/submission_helper.rb +++ b/lib/submission_helper.rb @@ -87,7 +87,7 @@ :cmp_msg => cmp_msg} else return {:points => 0, - :comment => 'compile error', + :comment => 'compilation error', :cmp_msg => cmp_msg} end end @@ -103,6 +103,8 @@ submission.grader_comment = 'PASSED: ' + comment + '(problem is nil)' elsif points == problem.full_score submission.grader_comment = 'PASSED: ' + comment + elsif result[:comment].chomp =~ /^[\[\]P]+$/ + submission.grader_comment = 'PASSED: ' + comment + '(inconsistent score)' else submission.grader_comment = 'FAILED: ' + comment end diff --git a/test/data/test1_compile_error.c b/test/data/test1_compile_error.c --- a/test/data/test1_compile_error.c +++ b/test/data/test1_compile_error.c @@ -1,3 +1,6 @@ +/* +LANG: C +*/ #include int main() diff --git a/test/data/test1_correct.c b/test/data/test1_correct.c --- a/test/data/test1_correct.c +++ b/test/data/test1_correct.c @@ -1,3 +1,6 @@ +/* +LANG: C +*/ #include int main() diff --git a/test/engine_spec.rb b/test/engine_spec.rb --- a/test/engine_spec.rb +++ b/test/engine_spec.rb @@ -33,7 +33,7 @@ :on => @problem_test_normal, :and_report => { :score => 0, - :comment => 'FAILED: compile error', + :comment => 'FAILED: compilation error', :compiler_message => /[Ee]rror/}) end