# HG changeset patch # User jittat # Date 2008-03-26 03:24:23 # Node ID fdbf2dc47aa1669f30997aadf038b27145bfc0df # Parent 7a9b64601b9d3fd8796003de20a503c5cfa8af40 [web] allow check script to inject the comment git-svn-id: http://theory.cpe.ku.ac.th/grader/judge/trunk/scripts@152 6386c4cd-e34a-4fa8-8920-d93eb39b512e diff --git a/std-script/grade b/std-script/grade --- a/std-script/grade +++ b/std-script/grade @@ -18,12 +18,14 @@ end def char_comment(comment) - if comment =~ /[iI]ncorrect/ + if comment =~ /[Ii]ncorrect/ INCORRECT_MARK elsif comment =~ /[Cc]orrect/ CORRECT_MARK elsif comment =~ /[Tt]ime/ TIMEOUT_MARK + elsif res = /^[Cc]omment:(.*)$/.match(comment) + res[1] else RUN_ERROR_MARK # these are run time errors end @@ -59,7 +61,7 @@ if result_file_lines.length>=2 run_score = run_score + result_file_lines[1].to_i run_comment += result_file_lines[0] - run_comment_short += char_comment(result_file_lines[0]) + run_comment_short += char_comment(result_file_lines[0].chomp) else run_comment += "result file for test #{test_num} error\n" run_comment_short += RUN_ERROR_MARK