|
|
|
@ -27,9 +27,15 @@ class MyshixunsController < ApplicationController
|
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
|
@myshixun.destroy!
|
|
|
|
|
|
|
|
|
|
StudentWork.where(:myshixun_id => @myshixun.id).includes(:shixun_work_comments, :student_works_scores, :challenge_work_scores).each do |work|
|
|
|
|
|
work.shixun_work_comments.destroy_all
|
|
|
|
|
work.student_works_scores.destroy_all
|
|
|
|
|
work.challenge_work_scores.destroy_all
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
StudentWork.where(:myshixun_id => @myshixun.id)
|
|
|
|
|
.update_all(myshixun_id: 0, work_status: 0, work_score: nil,
|
|
|
|
|
final_score: nil, efficiency: 0, eff_score: 0, calculation_time: nil, cost_time: 0, compelete_status: -1)
|
|
|
|
|
final_score: nil, efficiency: 0, eff_score: 0, calculation_time: nil, ultimate_score: 0, cost_time: 0, compelete_status: -1)
|
|
|
|
|
end
|
|
|
|
|
# 删除版本库
|
|
|
|
|
GitService.delete_repository(repo_path: @repo_path) unless @shixun.is_choice_type?
|
|
|
|
|