访问问卷报500

This commit is contained in:
sw 2015-08-29 11:17:46 +08:00
parent 86e9ec068f
commit 7263598851
1 changed files with 11 additions and 1 deletions

View File

@ -37,7 +37,17 @@ module PollHelper
pv.vote_text
end
end
#判断用户是否已经提交了问卷
def has_commit_poll?(poll_id,user_id)
pu = PollUser.find_by_poll_id_and_user_id(poll_id,user_id)
if pu.nil?
false
else
true
end
end
#统计答题百分比,统计结果保留两位小数
def statistics_result_percentage(e, t)
e = e.to_f