diff --git a/app/helpers/poll_helper.rb b/app/helpers/poll_helper.rb index 55418faf2..36b5deccb 100644 --- a/app/helpers/poll_helper.rb +++ b/app/helpers/poll_helper.rb @@ -48,15 +48,16 @@ module PollHelper end end - #统计答题百分比 + #统计答题百分比,统计结果保留两位小数 def statistics_result_percentage(e, t) e = e.to_f t = t.to_f t == 0 ? 0 : format("%.2f", e*100/t) end - def options_show p - case p + #页面体型显示 + def options_show pq + case pq when 1 "单选题" when 2 @@ -65,4 +66,5 @@ module PollHelper "问答题" end end + end \ No newline at end of file diff --git a/app/views/poll/_choice_show.html.erb b/app/views/poll/_choice_show.html.erb index 16971d5ad..4ccc5b938 100644 --- a/app/views/poll/_choice_show.html.erb +++ b/app/views/poll/_choice_show.html.erb @@ -19,7 +19,7 @@ <% end %> <%= l(:label_poll_valid_commit) %> - <%= poll_question.poll_votes.count %> + <%= @poll.users.count %>   diff --git a/app/views/poll/show.html.erb b/app/views/poll/show.html.erb index c1ac5d377..bc5136718 100644 --- a/app/views/poll/show.html.erb +++ b/app/views/poll/show.html.erb @@ -180,7 +180,7 @@ } - > + > <% elsif pq.question_type == 4 %> @@ -222,7 +222,7 @@ }); } -
" onblur="onblur_<%= pq.id %>(this);"><%= get_anwser_vote_text(pq.id,User.current.id) %>
+
" onblur="onblur_<%= pq.id %>(this);"><%= get_anwser_vote_text(pq.id,User.current.id).html_safe %>
diff --git a/app/views/poll/statistics_result.html.erb b/app/views/poll/statistics_result.html.erb index 057314a9c..3ef29eb48 100644 --- a/app/views/poll/statistics_result.html.erb +++ b/app/views/poll/statistics_result.html.erb @@ -27,7 +27,7 @@
- +