From fc72d6f9a9710256f70ee98a9a9db4030b1bcceb Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 13 Jan 2015 15:59:02 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E9=97=AE=E5=8D=B7=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E3=80=81=E9=97=AE=E5=8D=B7=E7=AD=94=E5=8D=B7=E7=AD=89?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E8=B7=B3=E8=BD=AC=EF=BC=8C=E5=B9=B6=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=AF=B9=E5=BA=94=E8=B7=AF=E7=94=B1=202.=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E9=A1=B5=E9=9D=A2=E6=A0=B7=E5=BC=8F=203.=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 13 +- app/views/poll/index.html.erb | 22 +-- app/views/poll/show.html.erb | 114 +++++++++++ app/views/poll/statistics_result.html.erb | 220 ++++++++++++++++++++++ config/routes.rb | 6 +- public/stylesheets/polls.css | 2 +- 6 files changed, 356 insertions(+), 21 deletions(-) create mode 100644 app/views/poll/show.html.erb create mode 100644 app/views/poll/statistics_result.html.erb 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 @@ - - -
- -+ <%= @poll.polls_description %> +
++ + | +
+ + | +
+ + | +
+ + | +
+ + | +
+ + | +
选项 | +小计 | +比例 | +
第一选项 | +24 | + 75% |
+
第二选项 | +1 | +3.13% |
+
第三选项 | +1 | +3.13% |
+
本题有效填写人次 | +26 | ++ |
选项 | +小计 | +比例 | +
第一选项 | +24 | + 75% |
+
第二选项 | +1 | +3.13% |
+
第三选项 | +1 | +3.13% |
+
本题有效填写人次 | +26 | ++ |
选项 | +小计 | +比例 | +
第一选项 | +24 | + 75% |
+
第二选项 | +1 | +3.13% |
+
第三选项 | +1 | +3.13% |
+
本题有效填写人次 | +26 | ++ |
选项 | +小计 | +比例 | +
第一选项 | +24 | + 75% |
+
第二选项 | +1 | +3.13% |
+
第三选项 | +1 | +3.13% |
+
本题有效填写人次 | +26 | ++ |
选项 | +小计 | +比例 | +
第一选项 | +24 | + 75% |
+
第二选项 | +1 | +3.13% |
+
第三选项 | +1 | +3.13% |
+
本题有效填写人次 | +26 | ++ |