diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index aaffc34a6..af1dffe71 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -272,7 +272,7 @@ class HomeworkCommonsController < ApplicationController def update_student_score work = @homework.student_works.find_by(user_id: current_user.id) myshixun = Myshixun.find_by(shixun_id: params[:shixun_id], user_id: current_user.id) - ActiveRecord::Base.transaction do + ActiveRecord::Base.transaction do begin if work && myshixun && (work.update_time.nil? || work.update_time < myshixun.updated_at) challenge_settings = @homework.homework_challenge_settings