Description:
[grader] hack on language for output-only task
git-svn-id: http://theory.cpe.ku.ac.th/grader/judge/trunk/scripts@190 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
r50:6e02aa1a5841 - - 1 file changed: 7 inserted, 0 deleted
@@ -24,26 +24,33 | |||||
|
24 | def grade(submission) |
|
24 | def grade(submission) |
|
25 | current_dir = `pwd`.chomp |
|
25 | current_dir = `pwd`.chomp |
|
26 |
|
26 | ||
|
27 | user = submission.user |
|
27 | user = submission.user |
|
28 | problem = submission.problem |
|
28 | problem = submission.problem |
|
29 |
|
29 | ||
|
30 | # TODO: will have to create real exception for this |
|
30 | # TODO: will have to create real exception for this |
|
31 | if user==nil or problem == nil |
|
31 | if user==nil or problem == nil |
|
32 | @reporter.report_error(submission,"Grading error: problem with submission") |
|
32 | @reporter.report_error(submission,"Grading error: problem with submission") |
|
33 | #raise "engine: user or problem is nil" |
|
33 | #raise "engine: user or problem is nil" |
|
34 | end |
|
34 | end |
|
35 |
|
35 | ||
|
|
36 | + # TODO: this is another hack so that output only task can be judged | ||
|
|
37 | + if submission.language!=nil | ||
|
36 | language = submission.language.name |
|
38 | language = submission.language.name |
|
37 | lang_ext = submission.language.ext |
|
39 | lang_ext = submission.language.ext |
|
|
40 | + else | ||
|
|
41 | + language = 'c' | ||
|
|
42 | + lang_ext = 'c' | ||
|
|
43 | + end | ||
|
|
44 | + | ||
|
38 | # FIX THIS |
|
45 | # FIX THIS |
|
39 | talk 'some hack on language' |
|
46 | talk 'some hack on language' |
|
40 | if language == 'cpp' |
|
47 | if language == 'cpp' |
|
41 | language = 'c++' |
|
48 | language = 'c++' |
|
42 | end |
|
49 | end |
|
43 |
|
50 | ||
|
44 | # COMMENT: should it be only source.ext? |
|
51 | # COMMENT: should it be only source.ext? |
|
45 | if problem!=nil |
|
52 | if problem!=nil |
|
46 | source_name = "#{problem.name}.#{lang_ext}" |
|
53 | source_name = "#{problem.name}.#{lang_ext}" |
|
47 | else |
|
54 | else |
|
48 | source_name = "source.#{lang_ext}" |
|
55 | source_name = "source.#{lang_ext}" |
|
49 | end |
|
56 | end |
You need to be logged in to leave comments.
Login now