diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 791d9e398..d1835408f 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -773,7 +773,7 @@ class StudentWorkController < ApplicationController pros = @work.student_work_projects.where("is_leader = 0") user_ids = pros.empty? ? "(-1)" : "(" + pros.map{|stu|stu.user_id}.join(",") + ")" student_works = @homework.student_works.where("user_id in #{user_ids}") - student_works.update_all(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0, :commit_time => nil, :project_id => 0) + student_works.delete_all pros.delete_all project = @work.student_work_projects.where("is_leader = 1").first