|
|
@ -951,7 +951,6 @@ class PollsController < ApplicationController
|
|
|
|
def poll_lists
|
|
|
|
def poll_lists
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
begin
|
|
|
|
begin
|
|
|
|
@poll_new_users = @poll.poll_users.find_by(user_id:current_user.id)
|
|
|
|
|
|
|
|
poll_ids = [@poll.id]
|
|
|
|
poll_ids = [@poll.id]
|
|
|
|
@poll_list_status = @poll.get_poll_status(current_user.id)
|
|
|
|
@poll_list_status = @poll.get_poll_status(current_user.id)
|
|
|
|
@poll_publish_count = get_user_permission_course(poll_ids,2).count
|
|
|
|
@poll_publish_count = get_user_permission_course(poll_ids,2).count
|
|
|
@ -1185,7 +1184,7 @@ class PollsController < ApplicationController
|
|
|
|
def check_poll_commit_result
|
|
|
|
def check_poll_commit_result
|
|
|
|
poll_status = @poll.get_poll_status(current_user.id)
|
|
|
|
poll_status = @poll.get_poll_status(current_user.id)
|
|
|
|
commit_poll_user = @poll.poll_users.find_by_group_ids(current_user.id).commit_by_status(1) #当前用户已提交问卷的
|
|
|
|
commit_poll_user = @poll.poll_users.find_by_group_ids(current_user.id).commit_by_status(1) #当前用户已提交问卷的
|
|
|
|
unless (@user_course_identity < Course::STUDENT) || (@poll.show_result && poll_status == 3 && commit_poll_user.present?)
|
|
|
|
unless (@user_course_identity < Course::STUDENT) || ((@poll.show_result == 1) && (poll_status == 3) && commit_poll_user.present?)
|
|
|
|
normal_status(-1,"没有权限!") #当前为老师/问卷公开统计,且问卷已截止,且用户有过回答的
|
|
|
|
normal_status(-1,"没有权限!") #当前为老师/问卷公开统计,且问卷已截止,且用户有过回答的
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|