Description:
fixed grading wrong submission when 2 submissions created at the same time
git-svn-id: http://theory.cpe.ku.ac.th/grader/judge/trunk/scripts@373 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
r68:fd3aca136ef8 - - 1 file changed: 1 inserted, 4 deleted
@@ -25,16 +25,13 | |||
|
25 | 25 | end |
|
26 | 26 | |
|
27 | 27 | def grade_problem(problem) |
|
28 | 28 | users = User.find(:all) |
|
29 | 29 | users.each do |u| |
|
30 | 30 | puts "user: #{u.login}" |
|
31 |
- last_sub = Submission.find( |
|
|
32 | - :conditions => "user_id = #{u.id} and " + | |
|
33 | - "problem_id = #{problem.id}", | |
|
34 | - :order => 'submitted_at DESC') | |
|
31 | + last_sub = Submission.find_last_by_user_and_problem(u.id,problem.id) | |
|
35 | 32 | if last_sub!=nil |
|
36 | 33 | @engine.grade(last_sub) |
|
37 | 34 | end |
|
38 | 35 | end |
|
39 | 36 | end |
|
40 | 37 |
You need to be logged in to leave comments.
Login now