From c964194d85a7ada908ef05a5874174d211b7c759 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 12 Jan 2015 16:02:15 +0800
Subject: [PATCH 01/99] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=97=AE=E5=8D=B7?=
=?UTF-8?q?=E8=B0=83=E6=9F=A5=E7=9B=B8=E5=85=B3=E7=9A=84=E8=B7=AF=E7=94=B1?=
=?UTF-8?q?=E3=80=81action=E3=80=81=E4=BB=A5=E5=8F=8A=E9=83=A8=E5=88=86?=
=?UTF-8?q?=E5=AF=B9=E5=BA=94=E7=9A=84=E9=A1=B5=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/poll_controller.rb | 110 +++++++++++++++++++++++++++++
app/views/poll/add_answer.html.erb | 0
app/views/poll/destroy.js.erb | 1 +
app/views/poll/edit.html.erb | 13 ++++
app/views/poll/index.html.erb | 7 ++
app/views/poll/new.html.erb | 0
config/routes.rb | 9 +++
7 files changed, 140 insertions(+)
create mode 100644 app/views/poll/add_answer.html.erb
create mode 100644 app/views/poll/destroy.js.erb
create mode 100644 app/views/poll/edit.html.erb
create mode 100644 app/views/poll/index.html.erb
create mode 100644 app/views/poll/new.html.erb
diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb
index a21fdb549..fbfef025e 100644
--- a/app/controllers/poll_controller.rb
+++ b/app/controllers/poll_controller.rb
@@ -1,2 +1,112 @@
class PollController < ApplicationController
+ before_filter :find_poll_and_course, :only => [:edit,:update,:destory]
+ before_filter :find_container, :only => [:new,:create, :index]
+
+ def index
+ if @course
+ @polls = Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id}")
+ respond_to do |format|
+ format.html{render :layout => 'base_courses'}
+ end
+ elsif @project
+ #项目的问卷调查相关代码
+ end
+ end
+
+ def show
+ @poll = Poll.find params[:id]
+ end
+
+ def new
+ if @course
+ option = {
+ :polls_name => "未命名问卷",
+ :polls_type => @course.class.to_s,
+ :polls_group_id => @course.id,
+ :polls_status => 1,
+ :user_id => User.current.id,
+ :published_at => Time.now,
+ :closed_at => Time.now,
+ :polls_description => ""
+ }
+ @poll = Poll.create option
+ if @poll
+ respond_to do |format|
+ format.html{render :layout => 'base_courses'}
+ end
+ end
+ elsif @project
+ #项目的问卷调查相关代码
+ end
+ end
+
+ def create
+ end
+
+ def edit
+ respond_to do |format|
+ format.html{render :layout => 'base_courses'}
+ end
+ end
+
+ def update
+ @poll.polls_name = params[:polls_name]
+ if @poll.save
+ respond_to do |format|
+ format.html { redirect_to poll_index_url(:polls_type => @course.class.to_s, :polls_group_id => @course.id) }
+ end
+ else
+ end
+ end
+
+ def destroy
+ if @poll.destroy
+ respond_to do |format|
+ format.js
+ end
+ end
+ end
+
+ #修改问卷标题和描述
+ def save_polls
+
+ end
+
+ #添加问题
+ def add_question
+ end
+
+ #添加选项
+ def add_answer
+ puts '1111111111111'
+ end
+
+ #选答案
+ def vote
+ end
+
+ #统计
+ def statistics
+ end
+
+ private
+ def find_poll_and_course
+ @poll = Poll.find params[:id]
+ @course = Course.find @poll.polls_group_id
+ rescue Exception => e
+ render_404
+ end
+
+ def find_container
+ if params[:polls_type] && params[:polls_group_id]
+ case params[:polls_type]
+ when "Course"
+ @course = Course.find_by_id params[:polls_group_id]
+ when "Project"
+ @project = Project.find_by_id params[:polls_group_id]
+ end
+ else
+ render_404
+ end
+ end
end
\ No newline at end of file
diff --git a/app/views/poll/add_answer.html.erb b/app/views/poll/add_answer.html.erb
new file mode 100644
index 000000000..e69de29bb
diff --git a/app/views/poll/destroy.js.erb b/app/views/poll/destroy.js.erb
new file mode 100644
index 000000000..a9efe790e
--- /dev/null
+++ b/app/views/poll/destroy.js.erb
@@ -0,0 +1 @@
+alert("删除成功");
\ No newline at end of file
diff --git a/app/views/poll/edit.html.erb b/app/views/poll/edit.html.erb
new file mode 100644
index 000000000..a35b1d2e7
--- /dev/null
+++ b/app/views/poll/edit.html.erb
@@ -0,0 +1,13 @@
+
+<%= form_for(@poll) do |f|%>
+ <%= f.text_field :polls_name, :required => true, :name => "polls_name"%>
+
+ <%= l(:label_button_ok) %>
+
+<% end%>
+
diff --git a/app/views/poll/index.html.erb b/app/views/poll/index.html.erb
new file mode 100644
index 000000000..4cf90d210
--- /dev/null
+++ b/app/views/poll/index.html.erb
@@ -0,0 +1,7 @@
+<% @polls.each do |poll|%>
+ <%= poll.id%>#####<%= poll.polls_name%>
+ <%= link_to l(:button_edit), edit_poll_path(poll.id)%>
+ <%= link_to(l(:button_delete), poll,
+ method: :delete, :confirm => l(:text_are_you_sure), :remote => true ) %>
+
+<%end%>
\ No newline at end of file
diff --git a/app/views/poll/new.html.erb b/app/views/poll/new.html.erb
new file mode 100644
index 000000000..e69de29bb
diff --git a/config/routes.rb b/config/routes.rb
index 5611ed2b6..222fe17eb 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -58,6 +58,15 @@ RedmineApp::Application.routes.draw do
end
end
+ resources :poll do
+ member do
+ get 'add_question'
+ get 'add_answer'
+ get 'vote'
+ get 'statistics'
+ end
+ end
+
resources :contest_notification
resources :open_source_projects do
From c0fa21eb9f605ef9357aa368fe84de339bf904bc Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 12 Jan 2015 16:07:15 +0800
Subject: [PATCH 02/99] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E8=B0=83=E6=9F=A5?=
=?UTF-8?q?=E8=A1=A8=E5=A2=9E=E5=8A=A0=E6=8F=8F=E8=BF=B0=E5=88=97?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
db/migrate/20150112080435_add_description_to_polls.rb | 9 +++++++++
1 file changed, 9 insertions(+)
create mode 100644 db/migrate/20150112080435_add_description_to_polls.rb
diff --git a/db/migrate/20150112080435_add_description_to_polls.rb b/db/migrate/20150112080435_add_description_to_polls.rb
new file mode 100644
index 000000000..135dc6bd4
--- /dev/null
+++ b/db/migrate/20150112080435_add_description_to_polls.rb
@@ -0,0 +1,9 @@
+class AddDescriptionToPolls < ActiveRecord::Migration
+ def up
+ add_column :polls, :polls_description, :text
+ end
+
+ def down
+ remove_column :polls,:polls_description
+ end
+end
From d0a6fa64e57683561d725aea1a3441724bfe07bc Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 12 Jan 2015 16:27:47 +0800
Subject: [PATCH 03/99] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B7=AF=E7=94=B1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
config/routes.rb | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/config/routes.rb b/config/routes.rb
index 222fe17eb..911a0643f 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -58,14 +58,7 @@ RedmineApp::Application.routes.draw do
end
end
- resources :poll do
- member do
- get 'add_question'
- get 'add_answer'
- get 'vote'
- get 'statistics'
- end
- end
+ resources :poll
resources :contest_notification
From 1c24a306fe5b7476cd2a7dcd4b1bab7ae5ed90a2 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 12 Jan 2015 16:37:23 +0800
Subject: [PATCH 04/99] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=97=A0=E7=94=A8?=
=?UTF-8?q?=E7=9A=84control?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/poll_answer_controller.rb | 2 -
app/controllers/poll_controller.rb | 112 --------------------
app/controllers/poll_question_controller.rb | 2 -
app/controllers/poll_user_controller.rb | 2 -
app/controllers/poll_vote_controller.rb | 2 -
5 files changed, 120 deletions(-)
delete mode 100644 app/controllers/poll_answer_controller.rb
delete mode 100644 app/controllers/poll_controller.rb
delete mode 100644 app/controllers/poll_question_controller.rb
delete mode 100644 app/controllers/poll_user_controller.rb
delete mode 100644 app/controllers/poll_vote_controller.rb
diff --git a/app/controllers/poll_answer_controller.rb b/app/controllers/poll_answer_controller.rb
deleted file mode 100644
index 521f7ed3f..000000000
--- a/app/controllers/poll_answer_controller.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-class PollAnswerController < ApplicationController
-end
\ No newline at end of file
diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb
deleted file mode 100644
index fbfef025e..000000000
--- a/app/controllers/poll_controller.rb
+++ /dev/null
@@ -1,112 +0,0 @@
-class PollController < ApplicationController
- before_filter :find_poll_and_course, :only => [:edit,:update,:destory]
- before_filter :find_container, :only => [:new,:create, :index]
-
- def index
- if @course
- @polls = Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id}")
- respond_to do |format|
- format.html{render :layout => 'base_courses'}
- end
- elsif @project
- #项目的问卷调查相关代码
- end
- end
-
- def show
- @poll = Poll.find params[:id]
- end
-
- def new
- if @course
- option = {
- :polls_name => "未命名问卷",
- :polls_type => @course.class.to_s,
- :polls_group_id => @course.id,
- :polls_status => 1,
- :user_id => User.current.id,
- :published_at => Time.now,
- :closed_at => Time.now,
- :polls_description => ""
- }
- @poll = Poll.create option
- if @poll
- respond_to do |format|
- format.html{render :layout => 'base_courses'}
- end
- end
- elsif @project
- #项目的问卷调查相关代码
- end
- end
-
- def create
- end
-
- def edit
- respond_to do |format|
- format.html{render :layout => 'base_courses'}
- end
- end
-
- def update
- @poll.polls_name = params[:polls_name]
- if @poll.save
- respond_to do |format|
- format.html { redirect_to poll_index_url(:polls_type => @course.class.to_s, :polls_group_id => @course.id) }
- end
- else
- end
- end
-
- def destroy
- if @poll.destroy
- respond_to do |format|
- format.js
- end
- end
- end
-
- #修改问卷标题和描述
- def save_polls
-
- end
-
- #添加问题
- def add_question
- end
-
- #添加选项
- def add_answer
- puts '1111111111111'
- end
-
- #选答案
- def vote
- end
-
- #统计
- def statistics
- end
-
- private
- def find_poll_and_course
- @poll = Poll.find params[:id]
- @course = Course.find @poll.polls_group_id
- rescue Exception => e
- render_404
- end
-
- def find_container
- if params[:polls_type] && params[:polls_group_id]
- case params[:polls_type]
- when "Course"
- @course = Course.find_by_id params[:polls_group_id]
- when "Project"
- @project = Project.find_by_id params[:polls_group_id]
- end
- else
- render_404
- end
- end
-end
\ No newline at end of file
diff --git a/app/controllers/poll_question_controller.rb b/app/controllers/poll_question_controller.rb
deleted file mode 100644
index 46a75c0ab..000000000
--- a/app/controllers/poll_question_controller.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-class PollQuestionController < ApplicationController
-end
\ No newline at end of file
diff --git a/app/controllers/poll_user_controller.rb b/app/controllers/poll_user_controller.rb
deleted file mode 100644
index 0373fe085..000000000
--- a/app/controllers/poll_user_controller.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-class PollUserController < ApplicationController
-end
\ No newline at end of file
diff --git a/app/controllers/poll_vote_controller.rb b/app/controllers/poll_vote_controller.rb
deleted file mode 100644
index e77bdc622..000000000
--- a/app/controllers/poll_vote_controller.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-class PollVoteController < ApplicationController
-end
\ No newline at end of file
From 475b046898373a5eb8f628dacf852c5516424303 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 12 Jan 2015 16:56:53 +0800
Subject: [PATCH 05/99] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=BF=E9=97=AEpoll#?=
=?UTF-8?q?index=E6=8A=A5ArgumentError?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/poll_controller.rb | 89 ++++++++++++++++++++++++++++++
app/views/poll/index.html.erb | 8 +--
config/locales/zh.yml | 1 +
3 files changed, 91 insertions(+), 7 deletions(-)
create mode 100644 app/controllers/poll_controller.rb
diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb
new file mode 100644
index 000000000..2a190166f
--- /dev/null
+++ b/app/controllers/poll_controller.rb
@@ -0,0 +1,89 @@
+class PollController < ApplicationController
+ before_filter :find_poll_and_course, :only => [:edit,:update,:destory]
+ before_filter :find_container, :only => [:new,:create, :index]
+
+ def index
+ if @course
+ @polls = Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id}")
+ respond_to do |format|
+ format.html{render :layout => 'base_courses'}
+ end
+ elsif @project
+ #项目的问卷调查相关代码
+ end
+ end
+
+ def show
+ @poll = Poll.find params[:id]
+ end
+
+ def new
+ if @course
+ option = {
+ :polls_name => l(:label_poll_new),
+ :polls_type => @course.class.to_s,
+ :polls_group_id => @course.id,
+ :polls_status => 1,
+ :user_id => User.current.id,
+ :published_at => Time.now,
+ :closed_at => Time.now,
+ :polls_description => ""
+ }
+ @poll = Poll.create option
+ if @poll
+ respond_to do |format|
+ format.html{render :layout => 'base_courses'}
+ end
+ end
+ elsif @project
+ #项目的问卷调查相关代码
+ end
+ end
+
+ def create
+
+ end
+
+ def edit
+
+ end
+
+ def update
+ @poll.polls_name = params[:polls_name]
+ if @poll.save
+ respond_to do |format|
+ format.html { redirect_to poll_index_url(:polls_type => @course.class.to_s, :polls_group_id => @course.id) }
+ end
+ else
+ end
+ end
+
+ def destroy
+ if @poll.destroy
+ respond_to do |format|
+ format.js
+ end
+ end
+ end
+
+ private
+ def find_poll_and_course
+ @poll = Poll.find params[:id]
+ @course = Course.find @poll.polls_group_id
+ rescue Exception => e
+ render_404
+ end
+
+ def find_container
+ if params[:polls_type] && params[:polls_group_id]
+ case params[:polls_type]
+ when "Course"
+ @course = Course.find_by_id params[:polls_group_id]
+ when "Project"
+ @project = Project.find_by_id params[:polls_group_id]
+ end
+ else
+ render_404
+ end
+ end
+end
\ No newline at end of file
diff --git a/app/views/poll/index.html.erb b/app/views/poll/index.html.erb
index 4cf90d210..3c78c257e 100644
--- a/app/views/poll/index.html.erb
+++ b/app/views/poll/index.html.erb
@@ -1,7 +1 @@
-<% @polls.each do |poll|%>
- <%= poll.id%>#####<%= poll.polls_name%>
- <%= link_to l(:button_edit), edit_poll_path(poll.id)%>
- <%= link_to(l(:button_delete), poll,
- method: :delete, :confirm => l(:text_are_you_sure), :remote => true ) %>
-
-<%end%>
\ No newline at end of file
+1111111111111
\ No newline at end of file
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index 568a60cac..abf20e370 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -2241,4 +2241,5 @@ zh:
label_quote_resource_failed: ",此资源引用失败! "
label_file_lost: 以下无法成功下载,请联系相关人员重新上传:
label_file_exist: 该作品中有重复命名文件,请通过文件名学号和姓名信息进入该作业详细界面手动下载
+ label_poll_new: 未命名问卷
From d2dfff33d019de2b54cd1013c8421c5662223062 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 12 Jan 2015 17:01:39 +0800
Subject: [PATCH 06/99] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E9=A1=B5=E9=9D=A2?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=97=AE=E5=8D=B7=E8=B0=83=E6=9F=A5=E7=9A=84?=
=?UTF-8?q?=E9=93=BE=E6=8E=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/base_courses.html.erb | 4 ++++
config/locales/zh.yml | 1 +
2 files changed, 5 insertions(+)
diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb
index 43adab15f..459fc43af 100644
--- a/app/views/layouts/base_courses.html.erb
+++ b/app/views/layouts/base_courses.html.erb
@@ -275,6 +275,10 @@
+
+
+ <%= link_to l(:label_poll), poll_index_path(:polls_type => "Course", :polls_group_id => @course.id)%>
+
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index abf20e370..f3e6d4d8d 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -2242,4 +2242,5 @@ zh:
label_file_lost: 以下无法成功下载,请联系相关人员重新上传:
label_file_exist: 该作品中有重复命名文件,请通过文件名学号和姓名信息进入该作业详细界面手动下载
label_poll_new: 未命名问卷
+ label_poll: 问卷调查
From 8080ca80643c84eac04e0ba9ee140debbf8c9220 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 12 Jan 2015 17:02:35 +0800
Subject: [PATCH 07/99] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=96=87=E4=BB=B6?=
=?UTF-8?q?=E7=95=8C=E9=9D=A2=E7=9A=84css?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/stylesheets/polls.css | 40 ++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
create mode 100644 public/stylesheets/polls.css
diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css
new file mode 100644
index 000000000..8621c20dc
--- /dev/null
+++ b/public/stylesheets/polls.css
@@ -0,0 +1,40 @@
+/* CSS Document */
+body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff; font-style:normal;}
+div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margin:0; padding:0;}
+div,img,tr,td{ border:0;}
+table,tr,td{border:0; cellspacing:0; cellpadding:0;}
+ul,li{ list-style-type:none}
+.cl{ clear:both; overflow:hidden; }
+a{ text-decoration:none; }
+a:hover{ text-decoration:underline; }
+.ml10{ margin-left:10px;}
+.ml20{ margin-left:20px;}
+.mr10{ margin-right:10px;}
+.fl{ float: left;}
+.fr{ float:right;}
+
+/*问卷列表*/
+.polls_content{ width:677px;}
+.polls_head{ width:677px; height:48px; background:#eaeaea;}
+.polls_head h2{ float:left; font-size:14px; color:#585858; margin:11px 0 0 10px;}
+.polls_head span{ font-weight:normal; color:#15bccf;}
+a.newbtn{ float:right; display:block; width:80px; height:30px; background:#64bdd9; color:#fff; font-size:14px; margin:10px; text-align:center;}
+a:hover.newbtn{ background:#55a1b9; text-decoration:none;}
+.polls_list ul{ padding-left:10px; border-bottom:1px dashed #c9c9c9; height:32px; padding-top:8px;}
+a.polls_title{ font-weight:bold; color:#3e6d8e;}
+a.pollsbtn{ display:block; width:66px; height:22px; text-align:center; border:1px solid #64bdd9; color:#64bdd9;}
+a:hover.pollsbtn{ background:#64bdd9; color:#fff; text-decoration:none;}
+.polls_date{ color:#666666;}
+.polls_de{ color:#6883b6;}
+/****翻页***/
+.wlist{}
+.wlist a{ float:right; border:1px solid #64bdd9; padding:0 5px; margin-left:3px; color:#64bdd9;}
+.wlist a:hover{border:1px solid #64bdd9; background-color:#64bdd9; color:#fff; text-decoration:none;}
+.wlist_select a { background-color:#48aac9; color:#fff;}
+
+/*问卷内容*/
+.polls_box{ border:1px solid #dcdcdc; padding:15px 30px 30px;}
+.ur_page_title{ font-size:16px; text-align:center; color:#353535;}
+.ur_prefix_content{ color:#656565; text-indent:30px; margin-top:10px; }
+.ur_card{border-top:1px solid #dcdcdc;margin-top:20px;}
+.ur_title{ padding:5px 0px 15px; border-bottom:1px solid #dcdcdc; }
From f54cf536632c8b380180b07b66c92400e922971a Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 12 Jan 2015 17:25:48 +0800
Subject: [PATCH 08/99] =?UTF-8?q?1.=E9=97=AE=E5=8D=B7=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=8A=A8=E6=80=81=E6=98=BE=E7=A4=BA=EF=BC=8C?=
=?UTF-8?q?=202.=E9=97=AE=E5=8D=B7=E8=B0=83=E6=9F=A5=E9=A1=B5=E9=9D=A2?=
=?UTF-8?q?=E5=BC=95=E8=B5=B7base=5Fcourse=E7=9A=84=E6=A0=B7=E5=BC=8F?=
=?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=B8=8D=E6=AD=A3=E7=A1=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/poll/index.html.erb | 52 ++++++++++++++++++++++++++++++++++-
public/stylesheets/polls.css | 24 ++++++++--------
2 files changed, 63 insertions(+), 13 deletions(-)
diff --git a/app/views/poll/index.html.erb b/app/views/poll/index.html.erb
index 3c78c257e..68d16f4f7 100644
--- a/app/views/poll/index.html.erb
+++ b/app/views/poll/index.html.erb
@@ -1 +1,51 @@
-1111111111111
\ No newline at end of file
+
+
+
+
+
问卷调查_列表
+ <%= stylesheet_link_tag 'polls', :media => 'all' %>
+
+
+
+
+
+
所有问卷
+ (<%= @polls.count%>)
+
+
新建问卷
+
+
+
+ <% @polls.each do |poll|%>
+
+
+ <% end%>
+
+
+
+
+
+
+
+
diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css
index 8621c20dc..9d3059245 100644
--- a/public/stylesheets/polls.css
+++ b/public/stylesheets/polls.css
@@ -1,17 +1,17 @@
/* CSS Document */
-body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff; font-style:normal;}
+#polls{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff; font-style:normal;}
div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margin:0; padding:0;}
-div,img,tr,td{ border:0;}
-table,tr,td{border:0; cellspacing:0; cellpadding:0;}
-ul,li{ list-style-type:none}
-.cl{ clear:both; overflow:hidden; }
-a{ text-decoration:none; }
-a:hover{ text-decoration:underline; }
-.ml10{ margin-left:10px;}
-.ml20{ margin-left:20px;}
-.mr10{ margin-right:10px;}
-.fl{ float: left;}
-.fr{ float:right;}
+#polls div,img,tr,td{ border:0;}
+#polls table,tr,td{border:0; cellspacing:0; cellpadding:0;}
+#polls ul,li{ list-style-type:none}
+#polls .cl{ clear:both; overflow:hidden; }
+#polls a{ text-decoration:none; }
+#polls a:hover{ text-decoration:underline; }
+#polls .ml10{ margin-left:10px;}
+#polls .ml20{ margin-left:20px;}
+#polls .mr10{ margin-right:10px;}
+#polls .fl{ float: left;}
+#polls .fr{ float:right;}
/*问卷列表*/
.polls_content{ width:677px;}
From 450c4b203dd2138cd3919ecb730b4bd29765eb41 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 12 Jan 2015 17:30:33 +0800
Subject: [PATCH 09/99] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=96=B0=E5=BB=BA?=
=?UTF-8?q?=E9=97=AE=E5=8D=B7=E6=8C=89=E9=92=AE=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/poll/index.html.erb | 2 +-
app/views/poll/new.html.erb | 1 +
config/locales/zh.yml | 1 +
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/app/views/poll/index.html.erb b/app/views/poll/index.html.erb
index 68d16f4f7..7c1529406 100644
--- a/app/views/poll/index.html.erb
+++ b/app/views/poll/index.html.erb
@@ -12,7 +12,7 @@
所有问卷
(<%= @polls.count%>)
-
新建问卷
+ <%= link_to l(:label_new_poll), new_poll_path(:polls_type => "Course",:polls_group_id => @course.id), :class => "newbtn" %>
diff --git a/app/views/poll/new.html.erb b/app/views/poll/new.html.erb
index e69de29bb..9d07aa0df 100644
--- a/app/views/poll/new.html.erb
+++ b/app/views/poll/new.html.erb
@@ -0,0 +1 @@
+111
\ No newline at end of file
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index f3e6d4d8d..b6a293c6a 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -2243,4 +2243,5 @@ zh:
label_file_exist: 该作品中有重复命名文件,请通过文件名学号和姓名信息进入该作业详细界面手动下载
label_poll_new: 未命名问卷
label_poll: 问卷调查
+ label_new_poll: 新建问卷
From d0dc01b99215177f7495e8fad7090277e9a96c72 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 12 Jan 2015 17:55:22 +0800
Subject: [PATCH 10/99] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=97=AE=E5=8D=B7?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8A=9F=E8=83=BD=EF=BC=8C=E4=BB=A5=E5=8F=8A?=
=?UTF-8?q?=E7=9B=B8=E5=85=B3js?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/poll_controller.rb | 4 ++--
app/views/poll/destroy.js.erb | 5 ++++-
app/views/poll/index.html.erb | 9 ++++++---
config/locales/zh.yml | 1 +
4 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb
index 2a190166f..5f0119022 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,:destory]
+ before_filter :find_poll_and_course, :only => [:edit,:update,:destroy]
before_filter :find_container, :only => [:new,:create, :index]
def index
@@ -59,7 +59,7 @@ class PollController < ApplicationController
end
def destroy
- if @poll.destroy
+ if @poll && @poll.destroy
respond_to do |format|
format.js
end
diff --git a/app/views/poll/destroy.js.erb b/app/views/poll/destroy.js.erb
index a9efe790e..abfecb167 100644
--- a/app/views/poll/destroy.js.erb
+++ b/app/views/poll/destroy.js.erb
@@ -1 +1,4 @@
-alert("删除成功");
\ No newline at end of file
+<% if @poll%>
+ $("#polls_<%= @poll.id%>").remove();
+<%else%>
+<% end %>
diff --git a/app/views/poll/index.html.erb b/app/views/poll/index.html.erb
index 7c1529406..39230774b 100644
--- a/app/views/poll/index.html.erb
+++ b/app/views/poll/index.html.erb
@@ -17,17 +17,20 @@
<% @polls.each do |poll|%>
-
+
<%= poll.polls_name%>
- 统计结果
+
+ <%= l(:label_statistical_results)%>
+
- 删除
+ <%= link_to(l(:button_delete), poll,
+ method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml20 mr10") %>
<%= format_time poll.created_at%>
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index b6a293c6a..7c93f8e98 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -2244,4 +2244,5 @@ zh:
label_poll_new: 未命名问卷
label_poll: 问卷调查
label_new_poll: 新建问卷
+ label_statistical_results: 统计结果
From 245f1a165c12c4bf16f2d6f34e24fb0f31bb8c2d Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Tue, 13 Jan 2015 08:48:38 +0800
Subject: [PATCH 11/99] =?UTF-8?q?=E6=9B=B4=E6=96=B0css=E6=96=87=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/stylesheets/polls.css | 33 +++++++++++++++++++++++++++++----
1 file changed, 29 insertions(+), 4 deletions(-)
diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css
index 9d3059245..7af93b999 100644
--- a/public/stylesheets/polls.css
+++ b/public/stylesheets/polls.css
@@ -32,9 +32,34 @@ a:hover.pollsbtn{ background:#64bdd9; color:#fff; text-decoration:none;}
.wlist a:hover{border:1px solid #64bdd9; background-color:#64bdd9; color:#fff; text-decoration:none;}
.wlist_select a { background-color:#48aac9; color:#fff;}
-/*问卷内容*/
-.polls_box{ border:1px solid #dcdcdc; padding:15px 30px 30px;}
+/*问卷页面*/
+.polls_box{ border:1px solid #dcdcdc; padding:15px 30px;}
.ur_page_title{ font-size:16px; text-align:center; color:#353535;}
.ur_prefix_content{ color:#656565; text-indent:30px; margin-top:10px; }
-.ur_card{border-top:1px solid #dcdcdc;margin-top:20px;}
-.ur_title{ padding:5px 0px 15px; border-bottom:1px solid #dcdcdc; }
+.ur_card{border-top:1px solid #dcdcdc;margin-top:20px; color:#3a3a3a;}
+.ur_title{ padding:20px 0px ; }
+.ur_required{ font-weight: bold; color:red;}
+.ur_inputs{ color:#666;}
+.ur_table{border-top:1px solid #dcdcdc;}
+.ur_inputs tr td{ height:40px;border-bottom:1px solid #dcdcdc; width:677px;}
+.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_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;}
+.ur_progress_text{ text-align:center; font-size:14px;}
+
+/*问卷结果*/
+.title_index{ color:#62bcd7;}
+.ur_title_result{ padding-top:20px;}
+.ur_table_result{ color:#5d5d5d;border-right:1px solid #cbcbcb;border-bottom:1px solid #cbcbcb;}
+.ur_table_result tr td{ border-left:1px solid #cbcbcb;border-top:1px solid #cbcbcb; height:20px;}
+.table_bluebg{ background:#d7e5ee; color:#2f3a40; height:24px;}
+.td327{ width:334px; padding-left:5px;}
+.td42{ width:42px; text-align:center;}
+.td287{ width:287px;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;}
From 6f19dd6c5cf9998c27ccb7781fbaf2540f90a027 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Tue, 13 Jan 2015 08:51:05 +0800
Subject: [PATCH 12/99] =?UTF-8?q?=E4=BF=AE=E6=94=B9css=E4=B8=AD=E7=9A=84?=
=?UTF-8?q?=E9=94=99=E8=AF=AF=E8=AF=AD=E6=B3=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/stylesheets/polls.css | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css
index 7af93b999..c83ef6833 100644
--- a/public/stylesheets/polls.css
+++ b/public/stylesheets/polls.css
@@ -62,4 +62,4 @@ a:hover.ur_button{ background:#0fa9bb; text-decoration:none;}
.td287{ width:287px;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;}
+.ur_progress_text{ color:#3a3a3a;}
From 32219bd8502737baff06f239109451a274875776 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Tue, 13 Jan 2015 10:23:26 +0800
Subject: [PATCH 13/99] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AE=BF=E9=97=AE?=
=?UTF-8?q?=E6=9D=83=E9=99=90=E6=8E=A7=E5=88=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/poll_controller.rb | 11 +++++++++++
app/views/poll/destroy.js.erb | 2 +-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb
index 5f0119022..cb01c573e 100644
--- a/app/controllers/poll_controller.rb
+++ b/app/controllers/poll_controller.rb
@@ -1,9 +1,12 @@
class PollController < ApplicationController
before_filter :find_poll_and_course, :only => [:edit,:update,:destroy]
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]
def index
if @course
+ @is_teacher = User.current.allowed_to?(:as_teacher,course)
@polls = Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id}")
respond_to do |format|
format.html{render :layout => 'base_courses'}
@@ -86,4 +89,12 @@ class PollController < ApplicationController
render_404
end
end
+
+ def is_member_of_course
+ render_403 unless(@course && User.current.member_of_course?(@course))
+ end
+
+ def is_course_teacher
+ render_403 unless(@course && User.current.allowed_to?(:as_teacher,course))
+ end
end
\ No newline at end of file
diff --git a/app/views/poll/destroy.js.erb b/app/views/poll/destroy.js.erb
index abfecb167..cf94b5661 100644
--- a/app/views/poll/destroy.js.erb
+++ b/app/views/poll/destroy.js.erb
@@ -1,4 +1,4 @@
<% if @poll%>
$("#polls_<%= @poll.id%>").remove();
<%else%>
-<% end %>
+<% end %>
\ No newline at end of file
From a18fa10de529208c4e264c94bb7c308481d2e1d2 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Tue, 13 Jan 2015 11:44:28 +0800
Subject: [PATCH 14/99] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E8=80=81=E5=B8=88?=
=?UTF-8?q?=E5=92=8C=E5=AD=A6=E7=94=9F=E6=98=BE=E7=A4=BA=E7=95=8C=E9=9D=A2?=
=?UTF-8?q?=E7=9A=84=E5=8C=BA=E5=88=AB=202.=E5=A2=9E=E5=8A=A0=E5=88=86?=
=?UTF-8?q?=E9=A1=B5=E7=9A=84=E5=8A=A8=E6=80=81=E6=98=BE=E7=A4=BA=EF=BC=8C?=
=?UTF-8?q?=E4=BB=A5=E5=8F=8A=E5=88=86=E9=A1=B5=E7=9B=B8=E5=85=B3css?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/poll_controller.rb | 7 ++++---
app/views/poll/index.html.erb | 22 +++++++++++-----------
public/stylesheets/polls.css | 9 +++++----
3 files changed, 20 insertions(+), 18 deletions(-)
diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb
index cb01c573e..d4e2517e7 100644
--- a/app/controllers/poll_controller.rb
+++ b/app/controllers/poll_controller.rb
@@ -6,8 +6,9 @@ class PollController < ApplicationController
def index
if @course
- @is_teacher = User.current.allowed_to?(:as_teacher,course)
- @polls = Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id}")
+ @is_teacher = User.current.allowed_to?(:as_teacher,@course)
+ polls = Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id}")
+ @polls = paginateHelper polls,10 #分页
respond_to do |format|
format.html{render :layout => 'base_courses'}
end
@@ -95,6 +96,6 @@ class PollController < ApplicationController
end
def is_course_teacher
- render_403 unless(@course && User.current.allowed_to?(:as_teacher,course))
+ render_403 unless(@course && User.current.allowed_to?(:as_teacher,@course))
end
end
\ No newline at end of file
diff --git a/app/views/poll/index.html.erb b/app/views/poll/index.html.erb
index 39230774b..fc36a8abf 100644
--- a/app/views/poll/index.html.erb
+++ b/app/views/poll/index.html.erb
@@ -24,13 +24,17 @@
-
- <%= l(:label_statistical_results)%>
-
+ <%if @is_teacher%>
+
+ <%= l(:label_statistical_results)%>
+
+ <% end%>
- <%= link_to(l(:button_delete), poll,
- method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml20 mr10") %>
+ <% if @is_teacher%>
+ <%= link_to(l(:button_delete), poll,
+ method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml20 mr10") %>
+ <% end%>
<%= format_time poll.created_at%>
@@ -39,12 +43,8 @@
<% end%>
-
- 下一页
- ...
- 2
- 1
- 上一页
+
+ <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css
index c83ef6833..494d9cb60 100644
--- a/public/stylesheets/polls.css
+++ b/public/stylesheets/polls.css
@@ -27,10 +27,11 @@ a:hover.pollsbtn{ background:#64bdd9; color:#fff; text-decoration:none;}
.polls_date{ color:#666666;}
.polls_de{ color:#6883b6;}
/****翻页***/
-.wlist{}
-.wlist a{ float:right; border:1px solid #64bdd9; padding:0 5px; margin-left:3px; color:#64bdd9;}
-.wlist a:hover{border:1px solid #64bdd9; background-color:#64bdd9; color:#fff; text-decoration:none;}
-.wlist_select a { background-color:#48aac9; color:#fff;}
+ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; }
+ul.wlist li{float: left;}
+ul.wlist li a{ border:1px solid #15bccf; padding:4px; margin-left:3px;}
+ul.wlist li a:hover{ background:#15bccf; color:#fff; text-decoration:none;}
+.wlist_select { background-color:#64bdd9; color:#fff; padding:0 5px; margin-left:3px;margin-top: -2px; border:1px solid #64bdd9;}
/*问卷页面*/
.polls_box{ border:1px solid #dcdcdc; padding:15px 30px;}
From d8e6b4a92f4a1f116e348f8152980d4489a7ae69 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Tue, 13 Jan 2015 11:54:07 +0800
Subject: [PATCH 15/99] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E5=8F=96=E6=B6=88?=
=?UTF-8?q?=E6=96=B0=E5=BB=BA=E9=97=AE=E5=8D=B7=E6=8C=89=E9=92=AE=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=20=E4=BF=AE=E6=94=B9=E9=97=AE=E5=8D=B7=E6=80=BB?=
=?UTF-8?q?=E6=95=B0=E6=98=BE=E7=A4=BA=E4=B8=8D=E6=AD=A3=E7=A1=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/poll/index.html.erb | 6 ++++--
public/stylesheets/polls.css | 2 +-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/app/views/poll/index.html.erb b/app/views/poll/index.html.erb
index fc36a8abf..0b49cd92d 100644
--- a/app/views/poll/index.html.erb
+++ b/app/views/poll/index.html.erb
@@ -10,9 +10,11 @@
所有问卷
- (<%= @polls.count%>)
+ (<%= @obj_count%>)
- <%= link_to l(:label_new_poll), new_poll_path(:polls_type => "Course",:polls_group_id => @course.id), :class => "newbtn" %>
+ <% if @is_teacher%>
+ <%= link_to l(:label_new_poll), new_poll_path(:polls_type => "Course",:polls_group_id => @course.id), :class => "newbtn" %>
+ <% end%>
diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css
index 494d9cb60..641d1726d 100644
--- a/public/stylesheets/polls.css
+++ b/public/stylesheets/polls.css
@@ -31,7 +31,7 @@ ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; }
ul.wlist li{float: left;}
ul.wlist li a{ border:1px solid #15bccf; padding:4px; margin-left:3px;}
ul.wlist li a:hover{ background:#15bccf; color:#fff; text-decoration:none;}
-.wlist_select { background-color:#64bdd9; color:#fff; padding:0 5px; margin-left:3px;margin-top: -2px; border:1px solid #64bdd9;}
+.wlist_select { background-color:#64bdd9; color:#fff; padding: 1px 5px 0px 5px; margin-left:3px;margin-top: -2px; border:1px solid #64bdd9;}
/*问卷页面*/
.polls_box{ border:1px solid #dcdcdc; padding:15px 30px;}
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 16/99] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E9=97=AE=E5=8D=B7?=
=?UTF-8?q?=E7=BB=9F=E8=AE=A1=E3=80=81=E9=97=AE=E5=8D=B7=E7=AD=94=E5=8D=B7?=
=?UTF-8?q?=E7=AD=89=E9=A1=B5=E9=9D=A2=E8=B7=B3=E8=BD=AC=EF=BC=8C=E5=B9=B6?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AF=B9=E5=BA=94=E8=B7=AF=E7=94=B1=202.?=
=?UTF-8?q?=E8=B0=83=E6=95=B4=E9=A1=B5=E9=9D=A2=E6=A0=B7=E5=BC=8F=203.?=
=?UTF-8?q?=E5=8A=A8=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 @@
-
-
-
-
-
问卷调查_列表
- <%= 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;}
From 8503f0c8030997ba050999e61e9e58a7761d6590 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Tue, 13 Jan 2015 16:58:44 +0800
Subject: [PATCH 17/99] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E6=9C=80=E6=96=B0?=
=?UTF-8?q?=E8=AE=BE=E8=AE=A1=E9=A1=B5=E9=9D=A2=EF=BC=8C=E4=BF=AE=E6=94=B9?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=98=BE=E7=A4=BA=E6=A0=B7=E5=BC=8F=EF=BC=8C?=
=?UTF-8?q?=E8=B0=83=E6=95=B4css=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/poll/index.html.erb | 2 +-
app/views/poll/statistics_result.html.erb | 10 +---
public/stylesheets/polls.css | 59 +++++++++++++++++++++--
3 files changed, 56 insertions(+), 15 deletions(-)
diff --git a/app/views/poll/index.html.erb b/app/views/poll/index.html.erb
index 79f930565..150c13382 100644
--- a/app/views/poll/index.html.erb
+++ b/app/views/poll/index.html.erb
@@ -1,5 +1,5 @@
<%= stylesheet_link_tag 'polls', :media => 'all' %>
-
+
所有问卷
(<%= @obj_count%>)
diff --git a/app/views/poll/statistics_result.html.erb b/app/views/poll/statistics_result.html.erb
index f07d17215..164020cde 100644
--- a/app/views/poll/statistics_result.html.erb
+++ b/app/views/poll/statistics_result.html.erb
@@ -7,7 +7,7 @@
-
+
某问卷统计
@@ -195,14 +195,6 @@
-
-
-
-
-
-
-
-