From 0f5c3c5f4c67ca373fb78cb7e6b2a1c9986cf13b Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 17 Jan 2015 11:46:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=BB=E8=A7=82=E9=A2=98?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E9=A1=B5=E9=9D=A2=E5=8F=8A=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/poll_helper.rb | 4 +++- app/views/poll/_quiz_answers.html.erb | 18 ++++++++++++++++++ app/views/poll/statistics_result.html.erb | 8 ++++++-- config/locales/zh.yml | 4 +++- public/stylesheets/polls.css | 1 + 5 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 app/views/poll/_quiz_answers.html.erb diff --git a/app/helpers/poll_helper.rb b/app/helpers/poll_helper.rb index 36b5deccb..47612f825 100644 --- a/app/helpers/poll_helper.rb +++ b/app/helpers/poll_helper.rb @@ -62,8 +62,10 @@ module PollHelper "单选题" when 2 "多选题" + when 3 + "单行主观" else - "问答题" + "多行主观" end end diff --git a/app/views/poll/_quiz_answers.html.erb b/app/views/poll/_quiz_answers.html.erb new file mode 100644 index 000000000..f2cfff5cc --- /dev/null +++ b/app/views/poll/_quiz_answers.html.erb @@ -0,0 +1,18 @@ +
+ + + + + + <% poll_question.poll_votes.each do |poll_vote| %> + + + + <% end %> + + + + +
<%= l(:label_answer) %>
<%= poll_vote.vote_text %>dddd
<%= l(:label_poll_answer_valid_result) %> <%= l(:label_answer_total) %><%= poll_question.poll_votes.count %>
+
+ diff --git a/app/views/poll/statistics_result.html.erb b/app/views/poll/statistics_result.html.erb index 3ef29eb48..a33daacfb 100644 --- a/app/views/poll/statistics_result.html.erb +++ b/app/views/poll/statistics_result.html.erb @@ -10,14 +10,18 @@

<%= @poll.polls_name %> <%= l(:label_poll) %>

- <% @poll_questions.each do |poll_question| %>
+ <% @poll_questions.each do |poll_question| %>
  1. 第<%= poll_question.question_number %>题:<%= poll_question.question_title %> [<%= options_show(poll_question.question_type) %>]
    - <%= render :partial =>'choice_show', :locals =>{ :poll_question => poll_question } %> + <% if poll_question.question_type == 1 || poll_question.question_type == 2 %> + <%= render :partial =>'choice_show', :locals =>{ :poll_question => poll_question } %> + <% else %> + <%= render :partial =>'quiz_answers', :locals =>{ :poll_question => poll_question } %> + <% end %>
<% end %> diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 5fe8a6560..7f7d00ba3 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2262,5 +2262,7 @@ zh: label_poll_proportion: 比例 label_poll_valid_commit: 本题有效填写人次 label_poll_result: 问卷调查_问卷统计 - + label_answer: 答案 + label_poll_answer_valid_result: 以上为有效问答题答案! + label_answer_total: 总计: diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css index e89e50be4..b81308c70 100644 --- a/public/stylesheets/polls.css +++ b/public/stylesheets/polls.css @@ -68,6 +68,7 @@ a:hover.ur_button{ background:#0fa9bb; text-decoration:none;} .td327{ width:300px; padding-left:5px;} .td42{ width:42px; text-align:center;} .td287{ width:259px;padding-left:5px; } +.td111{ width:601px;padding-left:5px; } .Bar{ position: relative; width: 120px; border: 1px solid #cbcbcb; float:left; height:10px; margin-top:5px; margin-right:3px; } .Bar span{ display: block; position: relative;background:#64badb;/* 进度条背景颜色 */ color: #333333;height: 10px; /* 高度 */ line-height: 20px; } .ur_progress_text{ color:#3a3a3a;}