|
|
|
@ -23,22 +23,16 @@ class MyshixunsController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
begin
|
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
|
begin
|
|
|
|
|
@shixun = Shixun.select(:id, :identifier, :challenges_count).find(@myshixun.shixun_id)
|
|
|
|
|
@myshixun.destroy!
|
|
|
|
|
StudentWork.where(:myshixun_id => @myshixun.id).update_all(myshixun_id: 0, work_status: 0, work_score: nil,
|
|
|
|
|
|
|
|
|
|
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: 0)
|
|
|
|
|
rescue Exception => e
|
|
|
|
|
logger.error("######reset_my_game_failed:#{e.message}")
|
|
|
|
|
raise("ActiveRecord::RecordInvalid")
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
# 删除版本库
|
|
|
|
|
GitService.delete_repository(repo_path: @repo_path) unless @shixun.is_choice_type?
|
|
|
|
|
rescue Exception => e
|
|
|
|
|
if e.message != "ActiveRecord::RecordInvalid"
|
|
|
|
|
logger.error("######delete_repository_error-:#{e.message}")
|
|
|
|
|
end
|
|
|
|
|
raise "delete_repository_error:#{e.message}"
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|