diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index d1c2b4bac..fb22d6378 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -1,7 +1,7 @@ class HomeworkCommonController < ApplicationController layout "base_courses" before_filter :find_course, :only => [:index,:new,:create] - before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment] + before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment] before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment] def index @@ -152,7 +152,10 @@ class HomeworkCommonController < ApplicationController #关闭匿评 def stop_anonymous_comment - + @homework_detail_manual.update_column('comment_status', 3) + respond_to do |format| + format.js + end end #提示 diff --git a/app/views/homework_common/stop_anonymous_comment.js.erb b/app/views/homework_common/stop_anonymous_comment.js.erb new file mode 100644 index 000000000..9a6131c64 --- /dev/null +++ b/app/views/homework_common/stop_anonymous_comment.js.erb @@ -0,0 +1,2 @@ +$("#<%= @homework.id %>_stop_anonymous_comment").replaceWith('匿评结束'); +alert('关闭成功'); \ No newline at end of file