This commit is contained in:
yuanke 2016-10-19 16:02:16 +08:00
parent 33155b4185
commit e42a42379d
1 changed files with 0 additions and 32 deletions

View File

@ -1,32 +0,0 @@
namespace :findworktest do
desc "Find student work error score test"
task :find=> :environment do
puts "start find."
worktests = StudentWorkTest.find_by_sql("select a.* from student_work_tests a where id = (select max(id) from student_work_tests where student_work_tests.student_work_id = a.student_work_id)")
allcount = 0
worktests.each do|worktest|
if !worktest.student_work.nil? && !worktest.student_work.homework_common.nil? && !worktest.student_work.homework_common.homework_tests.nil? && (worktest.student_work.homework_common.created_at.to_i > 1469980800)
testcount = worktest.student_work.homework_common.homework_tests.size
if testcount != worktest.results.count && worktest.student_work.system_score == 100
puts "------------------------------------"
puts "error score"
puts "testcount="+testcount.to_s
puts "resultscount="+worktest.results.count.to_s
puts "work_id="+worktest.student_work.id.to_s
puts "worktest_id="+worktest.id.to_s
puts "homework_common_id="+worktest.student_work.homework_common.id.to_s
puts "user_id="+worktest.student_work.user_id.to_s
allcount = allcount + 1
puts "allcount="+allcount.to_s
puts "------------------------------------"
end
end
end
puts "start end."
end
end