编程作业报500

This commit is contained in:
cxt 2016-10-20 17:46:33 +08:00
parent 0ccb6b884a
commit b0d089f85c
1 changed files with 4 additions and 2 deletions

View File

@ -3623,8 +3623,9 @@ def course_syllabus_option user = User.current
end
def create_works_list homework
students = homework.course.student
if !homework.course.nil? && !students.empty?
unless homework.course.nil?
students = homework.course.student
if !students.empty?
name = homework.name
name_str = name + "的作品提交"
str = ""
@ -3636,6 +3637,7 @@ def create_works_list homework
end
sql = "insert into student_works (name, homework_common_id,user_id, created_at, updated_at) values" + str
ActiveRecord::Base.connection.execute sql
end
end
end