Description:
updated graded_at fields for graded submissions
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r387:d79d1e42bcbb - - 1 file changed: 1 inserted, 0 deleted

@@ -30,18 +30,19
30 submissions = Submission.find_all_by_user_problem(u.id, problem.id)
30 submissions = Submission.find_all_by_user_problem(u.id, problem.id)
31 submissions.each do |sub|
31 submissions.each do |sub|
32 result = test_pair.grade(sub.output)
32 result = test_pair.grade(sub.output)
33 result2 = test_pair.grade(sub.source)
33 result2 = test_pair.grade(sub.source)
34 if result2[:score] > result[:score]
34 if result2[:score] > result[:score]
35 result = result2
35 result = result2
36 puts "Use source field (#{sub.id})"
36 puts "Use source field (#{sub.id})"
37 end
37 end
38
38
39 full_score = result[:full_score]
39 full_score = result[:full_score]
40 sub.points = result[:score]*100 / full_score
40 sub.points = result[:score]*100 / full_score
41 sub.grader_comment = result[:msg]
41 sub.grader_comment = result[:msg]
42 + sub.graded_at = Time.now.gmtime
42 sub.save
43 sub.save
43 end
44 end
44 end
45 end
45 end
46 end
46
47
47 main
48 main
You need to be logged in to leave comments. Login now