|
|
|
@ -15,6 +15,7 @@ class CourseMember < ActiveRecord::Base
|
|
|
|
|
homeworks = course.homework_commons.includes(:homework_detail_manual).where("homework_type in (1, 3, 4)")
|
|
|
|
|
if homeworks.count != 0
|
|
|
|
|
homeworks.each do |hw|
|
|
|
|
|
next if hw.student_works.where(user_id: user_id).any?
|
|
|
|
|
str += "," if str != ""
|
|
|
|
|
str += "('#{hw.name}的作品提交',#{hw.id},#{user_id}, '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}', '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}')"
|
|
|
|
|
end
|
|
|
|
@ -34,6 +35,7 @@ class CourseMember < ActiveRecord::Base
|
|
|
|
|
exercises = course.exercises
|
|
|
|
|
if exercises.count != 0
|
|
|
|
|
exercises.each do |ex|
|
|
|
|
|
next if ex.exercise_users.where(user_id: user_id).any?
|
|
|
|
|
str += "," if str != ""
|
|
|
|
|
str += "(#{ex.id},#{user_id}, 0, '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}', '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}')"
|
|
|
|
|
end
|
|
|
|
@ -53,6 +55,7 @@ class CourseMember < ActiveRecord::Base
|
|
|
|
|
polls = course.polls
|
|
|
|
|
if polls.count != 0
|
|
|
|
|
polls.each do |poll|
|
|
|
|
|
next if poll.poll_users.where(user_id: user_id).any?
|
|
|
|
|
str += "," if str != ""
|
|
|
|
|
str += "(#{poll.id},#{user_id}, 0, '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}', '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}')"
|
|
|
|
|
end
|
|
|
|
@ -72,6 +75,7 @@ class CourseMember < ActiveRecord::Base
|
|
|
|
|
tasks = course.graduation_tasks
|
|
|
|
|
if tasks.count != 0
|
|
|
|
|
tasks.each do |task|
|
|
|
|
|
next if task.graduation_works.where(user_id: user_id).any?
|
|
|
|
|
str += "," if str != ""
|
|
|
|
|
str += "(#{task.id}, #{user_id}, #{course.id}, '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}', '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}')"
|
|
|
|
|
end
|
|
|
|
|