#1949 学生可以通过url访问老师并未发布的问卷并进行作答

This commit is contained in:
sw 2015-03-03 17:53:15 +08:00
parent da21e61afd
commit 2c4e864080
1 changed files with 4 additions and 0 deletions

View File

@ -23,6 +23,10 @@ class PollController < ApplicationController
def show
@poll = Poll.find params[:id]
if @poll.polls_status != 2 && !User.current.allowed_to?(:as_teacher,@course)
render_403
return
end
#已提交问卷的用户不能再访问该界面
if has_commit_poll?(@poll.id,User.current.id) && (!User.current.admin?)
render_403