|
|
|
@ -1115,23 +1115,8 @@ class UsersController < ApplicationController
|
|
|
|
|
homework_detail_programing.save if homework_detail_programing
|
|
|
|
|
homework_detail_group.save if homework_detail_group
|
|
|
|
|
|
|
|
|
|
if homework.homework_type != 3
|
|
|
|
|
students = homework.course.student
|
|
|
|
|
if !homework.course.nil? && !students.empty?
|
|
|
|
|
name = homework.name
|
|
|
|
|
name_str = name + "的作品提交"
|
|
|
|
|
str = ""
|
|
|
|
|
students.each do |student|
|
|
|
|
|
if str != ""
|
|
|
|
|
str += ","
|
|
|
|
|
end
|
|
|
|
|
str += "('#{name_str}',#{homework.id},#{student.student_id}, '#{format_time(Time.now)}', '#{format_time(Time.now)}')"
|
|
|
|
|
end
|
|
|
|
|
#('#{name}的作品提交',#{homework.id},#{student.student_id}, '#{format_time(Time.now)}', '#{format_time(Time.now)}')
|
|
|
|
|
sql = "insert into student_works (name, homework_common_id,user_id, created_at, updated_at) values" + str
|
|
|
|
|
#StudentWork.create(:name => "#{name}的作品提交", :homework_common_id => homework.id, :user_id => student.student_id)
|
|
|
|
|
ActiveRecord::Base.connection.execute sql
|
|
|
|
|
end
|
|
|
|
|
if homework.homework_type != 3 && homework_detail_manual.comment_status == 1
|
|
|
|
|
create_works_list homework
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if params[:quotes] && !params[:quotes].blank?
|
|
|
|
|