sw 11 years ago
commit f99d159ca1

@ -50,7 +50,9 @@ module PollHelper
#统计答题百分比 #统计答题百分比
def statistics_result_percentage(e, t) def statistics_result_percentage(e, t)
return e*100/t e = e.to_f
t = t.to_f
t == 0 ? 0 : format("%.2f", e*100/t)
end end
def options_show p def options_show p

@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>问卷调查_问卷页面</title> <title><%= l(:label_poll_title) %></title>
<%= stylesheet_link_tag 'polls', :media => 'all' %> <%= stylesheet_link_tag 'polls', :media => 'all' %>
<style type="text/css"> <style type="text/css">
.alert_box{width:480px;height:180px;position:fixed;z-index:100;left:55%;top:50%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;} .alert_box{width:480px;height:180px;position:fixed;z-index:100;left:55%;top:50%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;}
@ -46,10 +46,10 @@
<!-- 单选题 --> <!-- 单选题 -->
<li class="ur_question_item radio"> <li class="ur_question_item radio">
<div class="ur_title"> <div class="ur_title">
<span class="title_index"><%= pq.question_number %>题:</span> <span class="title_index"><%= l(:label_question_number,:question_number => pq.question_number) %></span>
<%= pq.question_title %> <%= pq.question_title %>
<% if pq.is_necessary == 1 %> <% if pq.is_necessary == 1 %>
<span class="ur_required" title="必答">*</span> <span class="ur_required" title="<%= l(:label_must_answer) %>">*</span>
<% end %> <% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
@ -95,10 +95,10 @@
<!-- 多选题 --> <!-- 多选题 -->
<li class="ur_question_item checkbox"> <li class="ur_question_item checkbox">
<div class="ur_title"> <div class="ur_title">
<span class="title_index"><%= pq.question_number %>题:</span> <span class="title_index"><%= l(:label_question_number,:question_number => pq.question_number) %></span>
<%= pq.question_title %> <%= pq.question_title %>
<% if pq.is_necessary == 1 %> <% if pq.is_necessary == 1 %>
<span class="ur_required" title="必答">*</span> <span class="ur_required" title="<%= l(:label_must_answer) %>">*</span>
<% end %> <% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
@ -151,10 +151,10 @@
<!-- 单行文字--> <!-- 单行文字-->
<li class="ur_question_item text"> <li class="ur_question_item text">
<div class="ur_title"> <div class="ur_title">
<span class="title_index"><%= pq.question_number %>题:</span> <span class="title_index"><%= l(:label_question_number,:question_number => pq.question_number) %></span>
<%= pq.question_title %> <%= pq.question_title %>
<% if pq.is_necessary == 1 %> <% if pq.is_necessary == 1 %>
<span class="ur_required" title="必答">*</span> <span class="ur_required" title="<%= l(:label_must_answer) %>">*</span>
<% end %> <% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
@ -188,10 +188,10 @@
<li class="ur_question_item textarea"> <li class="ur_question_item textarea">
<div class="ur_preview"> <div class="ur_preview">
<div class="ur_title"> <div class="ur_title">
<span class="title_index"><%= pq.question_number %>题:</span> <span class="title_index"><%= l(:label_question_number,:question_number => pq.question_number) %></span>
<%= pq.question_title %> <%= pq.question_title %>
<% if pq.is_necessary == 1 %> <% if pq.is_necessary == 1 %>
<span class="ur_required" title="必答">*</span> <span class="ur_required" title="<%= l(:label_must_answer) %>">*</span>
<% end %> <% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
@ -237,11 +237,11 @@
<div class="cl"></div> <div class="cl"></div>
<div class="ur_buttons" style="width: 100px;"> <div class="ur_buttons" style="width: 100px;">
<% if @poll.polls_status == 2 %> <% if @poll.polls_status == 2 %>
<%= link_to "提交",commit_poll_poll_path(@poll), :method => :post,:class => "ur_button",:format => 'js',:remote=>true %> <%= link_to l(:button_submit),commit_poll_poll_path(@poll), :method => :post,:class => "ur_button",:format => 'js',:remote=>true %>
<% end %> <% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="ur_progress_text">答题已完成 <strong class="ur_progress_number"><span id="percent"><%= format "%.2f" ,@percent %></span>%</strong> </div> <div class="ur_progress_text"><%= l(:label_complete_question) %> <strong class="ur_progress_number"><span id="percent"><%= format "%.2f" ,@percent %></span>%</strong> </div>
</div> </div>

@ -5,20 +5,17 @@
<title><%= l(:label_poll_result) %></title> <title><%= l(:label_poll_result) %></title>
<%= stylesheet_link_tag 'polls', :media => 'all' %> <%= stylesheet_link_tag 'polls', :media => 'all' %>
</head> </head>
<body> <body>
<div class="polls_content polls_box" id="polls"> <div class="polls_content polls_box" id="polls">
<div class="ur_page_head" > <div class="ur_page_head" >
<h1 class="ur_page_title"><%= @poll.polls_name %> <%= l(:label_poll) %></h1> <h1 class="ur_page_title"><%= @poll.polls_name %> <%= l(:label_poll) %></h1>
</div> </div>
<% @poll_questions.each do |poll_question| %> <% @poll_questions.each do |poll_question| %>
<div class=""> <div class="">
<ol> <ol>
<li class="ur_question_item"> <li class="ur_question_item">
<div class="ur_title_result"> <div class="ur_title_result">
<span class="title_index">第<%= poll_question.question_number %>题:</span><%= poll_question.question_title %> <span class="title_index">第<%= poll_question.question_number %>题:</span><%= poll_question.question_title %> <span class="title_index">[<%= options_show(poll_question.question_type) %>]</span>
<span class="title_index">[<%= options_show(poll_question.question_type) %>]</span>
</div> </div>
<%= render :partial =>'choice_show', :locals =>{ :poll_question => poll_question } %> <%= render :partial =>'choice_show', :locals =>{ :poll_question => poll_question } %>
</li> </li>
@ -28,11 +25,9 @@
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%> <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul> </ul>
<div class="cl"></div> <div class="cl"></div>
<div class="ur_buttons"> <div class="ur_buttons"></div>
</div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div>
</div><!--问卷内容end-->
</body> </body>
</html> </html>

@ -1817,8 +1817,10 @@ en:
label_record: 湘ICP备09019772 label_record: 湘ICP备09019772
label_check_comment: Check comment label_check_comment: Check comment
label_notification: Notification label_notification: Notification
label_must_answer: Will answer
label_poll_title: The questionnaire survey _ questionnaire page
label_question_number: 'question %{question_number}:'
label_complete_question: The answer has been completed
#end #end
# ajax异步验证 # ajax异步验证

@ -964,6 +964,8 @@ zh:
label_default: 默认 label_default: 默认
label_search_titles_only: 仅在标题中搜索 label_search_titles_only: 仅在标题中搜索
label_user_mail_option_all: "收取我的项目的所有通知" label_user_mail_option_all: "收取我的项目的所有通知"
label_must_answer: "必答"
label_poll_title: 问卷调查_问卷页面
#huang #huang
label_file_new: 下载 label_file_new: 下载
label_user_edit: "修改资料" label_user_edit: "修改资料"
@ -1419,6 +1421,8 @@ zh:
other: 参与了 %{count} 个项目: other: 参与了 %{count} 个项目:
#end #end
label_total_commit: 共%{total_commit}次提交 label_total_commit: 共%{total_commit}次提交
label_question_number: 第%{question_number}题:
label_complete_question: 答题已完成
#modify by men #modify by men
label_x_total_commit: label_x_total_commit:
zero: 共 %{count} 次提交 zero: 共 %{count} 次提交

Loading…
Cancel
Save