diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb
index d4e2517e7..e5b1025a4 100644
--- a/app/controllers/poll_controller.rb
+++ b/app/controllers/poll_controller.rb
@@ -1,5 +1,5 @@
class PollController < ApplicationController
- before_filter :find_poll_and_course, :only => [:edit,:update,:destroy]
+ before_filter :find_poll_and_course, :only => [:edit,:update,:destroy,:show,:statistics_result]
before_filter :find_container, :only => [:new,:create, :index]
before_filter :is_member_of_course, :only => [:index,:show]
before_filter :is_course_teacher, :only => [:new,:create,:edit,:update,:destroy]
@@ -19,6 +19,11 @@ class PollController < ApplicationController
def show
@poll = Poll.find params[:id]
+ @poll_questions = @poll.poll_questions
+
+ respond_to do |format|
+ format.html {render :layout => 'base_courses'}
+ end
end
def new
@@ -70,6 +75,12 @@ class PollController < ApplicationController
end
end
+ def statistics_result
+ respond_to do |format|
+ format.html{render :layout => 'base_courses'}
+ end
+ end
+
private
def find_poll_and_course
@poll = Poll.find params[:id]
diff --git a/app/views/poll/index.html.erb b/app/views/poll/index.html.erb
index 0b49cd92d..79f930565 100644
--- a/app/views/poll/index.html.erb
+++ b/app/views/poll/index.html.erb
@@ -1,12 +1,4 @@
-
-
-
-
- 问卷调查_列表
- <%= stylesheet_link_tag 'polls', :media => 'all' %>
-
-
-
+<%= stylesheet_link_tag 'polls', :media => 'all' %>
所有问卷
@@ -21,15 +13,11 @@
<% @polls.each do |poll|%>
-
-
-
+
\ No newline at end of file
diff --git a/app/views/poll/show.html.erb b/app/views/poll/show.html.erb
new file mode 100644
index 000000000..66fcd3bcd
--- /dev/null
+++ b/app/views/poll/show.html.erb
@@ -0,0 +1,114 @@
+
+
+
+
+ 问卷调查_问卷页面
+ <%= stylesheet_link_tag 'polls', :media => 'all' %>
+
+
+
+
+
+
+ <%= @poll.polls_name%>
+
+
+ <%= @poll.polls_description %>
+
+
+
+
+
+
+
+ -
+
+ 第1题: 单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题 *
+
+
+
+
+ -
+
+ 第2题: 多选题 *
+
+
+
+
+
+ -
+
+ 第3题: 单行主观
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
答题已完成 0%
+
+
+
+
+
+
+
+
diff --git a/app/views/poll/statistics_result.html.erb b/app/views/poll/statistics_result.html.erb
new file mode 100644
index 000000000..f07d17215
--- /dev/null
+++ b/app/views/poll/statistics_result.html.erb
@@ -0,0 +1,220 @@
+
+
+
+
+ 问卷调查_问卷结果
+ <%= stylesheet_link_tag 'polls', :media => 'all' %>
+
+
+
+
+
+
某问卷统计
+
+
+
+
+
+ -
+
+ 第1题:问题描述问题描述 [单选题]
+
+
+
+
+
+ 选项 |
+ 小计 |
+ 比例 |
+
+
+ 第一选项 |
+ 24 |
+ 75% |
+
+
+ 第二选项 |
+ 1 |
+ 3.13% |
+
+
+ 第三选项 |
+ 1 |
+ 3.13% |
+
+
+ 本题有效填写人次 |
+ 26 |
+ |
+
+
+
+
+
+ -
+
+ 第1题:问题描述问题描述 [单选题]
+
+
+
+
+
+ 选项 |
+ 小计 |
+ 比例 |
+
+
+ 第一选项 |
+ 24 |
+ 75% |
+
+
+ 第二选项 |
+ 1 |
+ 3.13% |
+
+
+ 第三选项 |
+ 1 |
+ 3.13% |
+
+
+ 本题有效填写人次 |
+ 26 |
+ |
+
+
+
+
+
+ -
+
+ 第1题:问题描述问题描述 [单选题]
+
+
+
+
+
+ 选项 |
+ 小计 |
+ 比例 |
+
+
+ 第一选项 |
+ 24 |
+ 75% |
+
+
+ 第二选项 |
+ 1 |
+ 3.13% |
+
+
+ 第三选项 |
+ 1 |
+ 3.13% |
+
+
+ 本题有效填写人次 |
+ 26 |
+ |
+
+
+
+
+
+ -
+
+ 第1题:问题描述问题描述 [单选题]
+
+
+
+
+
+ 选项 |
+ 小计 |
+ 比例 |
+
+
+ 第一选项 |
+ 24 |
+ 75% |
+
+
+ 第二选项 |
+ 1 |
+ 3.13% |
+
+
+ 第三选项 |
+ 1 |
+ 3.13% |
+
+
+ 本题有效填写人次 |
+ 26 |
+ |
+
+
+
+
+
+ -
+
+ 第1题:问题描述问题描述 [单选题]
+
+
+
+
+
+ 选项 |
+ 小计 |
+ 比例 |
+
+
+ 第一选项 |
+ 24 |
+ 75% |
+
+
+ 第二选项 |
+ 1 |
+ 3.13% |
+
+
+ 第三选项 |
+ 1 |
+ 3.13% |
+
+
+ 本题有效填写人次 |
+ 26 |
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
答题已完成 0%
+
+
+
+
+
+
+
+
diff --git a/config/routes.rb b/config/routes.rb
index 911a0643f..617a5ade4 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -58,7 +58,11 @@ RedmineApp::Application.routes.draw do
end
end
- resources :poll
+ resources :poll do
+ member do
+ get 'statistics_result'
+ end
+ end
resources :contest_notification
diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css
index 641d1726d..3ace9e459 100644
--- a/public/stylesheets/polls.css
+++ b/public/stylesheets/polls.css
@@ -46,7 +46,7 @@ ul.wlist li a:hover{ background:#15bccf; color:#fff; text-decoration:none;}
.ur_inputs label{ padding-left:10px;}
.ur_inputs input{ margin-right:5px;}
.ur_text{ height:30px;}
-.ur_textbox{ border:1px solid #dcdcdc; color:#676765;}
+.ur_textbox{ border:1px solid #dcdcdc !important; color:#676765;}
.ur_buttons{ width:250px; margin:20px auto 10px;}
a.ur_button{ display:block; width:106px; height:37px; background:#15bccf; color:#fff; font-size:16px; text-align:center; padding-top:3px; float:left; margin-right:15px;}
a:hover.ur_button{ background:#0fa9bb; text-decoration:none;}