diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 394c52f13..1b2794034 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -83,6 +83,12 @@ class PollController < ApplicationController def destroy if @poll && @poll.destroy + if @is_teacher + polls = Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id}") + else + polls = Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id} and polls_status = 2") + end + @polls = paginateHelper polls,20 #分页 respond_to do |format| format.js end diff --git a/app/views/poll/_poll_list.html.erb b/app/views/poll/_poll_list.html.erb new file mode 100644 index 000000000..f57a4a5ff --- /dev/null +++ b/app/views/poll/_poll_list.html.erb @@ -0,0 +1,22 @@ +