diff --git a/app/controllers/exercise_controller.rb b/app/controllers/exercise_controller.rb index c8e5bf27c..d53dc067c 100644 --- a/app/controllers/exercise_controller.rb +++ b/app/controllers/exercise_controller.rb @@ -299,16 +299,21 @@ class ExerciseController < ApplicationController # 发布试卷 def publish_exercise + @is_teacher = User.current.allowed_to?(:as_teacher,@course) @exercise.exercise_status = 2 @exercise.publish_time = Time.now if @exercise.save - redirect_to exercise_index_url(:course_id=> @course.id) + #redirect_to exercise_index_url(:course_id=> @course.id) + respond_to do |format| + format.js + end end end # 重新发布试卷 # 重新发布的时候会删除所有的答题 def republish_exercise + @is_teacher = User.current.allowed_to?(:as_teacher,@course) @exercise.exercise_questions.each do |exercise_question| exercise_question.exercise_answers.destroy_all end diff --git a/app/views/exercise/_edit_MC.html.erb b/app/views/exercise/_edit_MC.html.erb index a1c8aa8b1..008c95c24 100644 --- a/app/views/exercise/_edit_MC.html.erb +++ b/app/views/exercise/_edit_MC.html.erb @@ -50,7 +50,7 @@
diff --git a/app/views/exercise/_new_single.html.erb b/app/views/exercise/_new_single.html.erb index 1ee79e198..08b31087a 100644 --- a/app/views/exercise/_new_single.html.erb +++ b/app/views/exercise/_new_single.html.erb @@ -40,7 +40,7 @@
diff --git a/app/views/exercise/_show_MC.html.erb b/app/views/exercise/_show_MC.html.erb index b932eac1e..5c214165a 100644 --- a/app/views/exercise/_show_MC.html.erb +++ b/app/views/exercise/_show_MC.html.erb @@ -90,7 +90,7 @@ ''+ ''+ ''+ ''+ '