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|%> -
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. +
    + 第1题: 单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题 * +
    +
    + + + + + + + + + + + + +
    + +
    + +
    + +
    +
    +
  2. + +
  3. +
    + 第2题: 多选题 * +
    +
    + + + + + + + + + + + + +
    + +
    + +
    + +
    +
    +
  4. + + +
  5. +
    + 第3题: 单行主观 +
    +
    + +
    +
  6. + +
  7. +
    +
    + 第4题: 多行主观 +
    +
    + +
    +
    +
  8. + +
+ + +
+
答题已完成 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. +
    + 第1题:问题描述问题描述 [单选题] +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    选项 小计 比例
    第一选项 24
    75%
    第二选项 1
    3.13%
    第三选项 1
    3.13%
    本题有效填写人次 26 
    +
    +
  2. +
  3. +
    + 第1题:问题描述问题描述 [单选题] +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    选项 小计 比例
    第一选项 24
    75%
    第二选项 1
    3.13%
    第三选项 1
    3.13%
    本题有效填写人次 26 
    +
    +
  4. +
  5. +
    + 第1题:问题描述问题描述 [单选题] +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    选项 小计 比例
    第一选项 24
    75%
    第二选项 1
    3.13%
    第三选项 1
    3.13%
    本题有效填写人次 26 
    +
    +
  6. +
  7. +
    + 第1题:问题描述问题描述 [单选题] +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    选项 小计 比例
    第一选项 24
    75%
    第二选项 1
    3.13%
    第三选项 1
    3.13%
    本题有效填写人次 26 
    +
    +
  8. +
  9. +
    + 第1题:问题描述问题描述 [单选题] +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    选项 小计 比例
    第一选项 24
    75%
    第二选项 1
    3.13%
    第三选项 1
    3.13%
    本题有效填写人次 26 
    +
    +
  10. + + + + + + + + +
+
+ + +
+
+
答题已完成 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 @@
- - - - - - - -
diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css index 3ace9e459..99e88c98d 100644 --- a/public/stylesheets/polls.css +++ b/public/stylesheets/polls.css @@ -14,7 +14,7 @@ div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margi #polls .fr{ float:right;} /*问卷列表*/ -.polls_content{ width:677px;} +.polls_content{ width:615px;} .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;} @@ -33,16 +33,17 @@ 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: 1px 5px 0px 5px; margin-left:3px;margin-top: -2px; border:1px solid #64bdd9;} + /*问卷页面*/ .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; color:#3a3a3a;} -.ur_title{ padding:20px 0px ; } +.ur_title{ padding:20px 0px ; float:left; width:604px; } .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 tr td{ height:40px;border-bottom:1px solid #dcdcdc; width:617px;} .ur_inputs label{ padding-left:10px;} .ur_inputs input{ margin-right:5px;} .ur_text{ height:30px;} @@ -58,9 +59,57 @@ a:hover.ur_button{ background:#0fa9bb; text-decoration:none;} .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;} +.td327{ width:300px; padding-left:5px;} .td42{ width:42px; text-align:center;} -.td287{ width:287px;padding-left:5px; } +.td287{ width:259px;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;} + +/*问卷编辑*/ +.polls_edit{ color:#767676;} +a:hover{ text-decoration:none; cursor:pointer;} +.tabs{ width:665px; height: auto; border:1px solid #cbcbcb; padding:10px 0 0 10px; margin-bottom:10px;} +.tab_item { float:left; height:30px; background:#eeeeee; margin-right:4px; padding:0 8px; margin-bottom:10px;} +.icon_delete{ font-size:16px;} +a:hover.icon_delete{ font-weight: bold;} +.current{ color:#4f4f4d; background:#c4c4c4;} +.tab_add{float:left; width:22px; height:22px; border:1px solid #cbcbcb; margin-top:6px; } +.icon_page_add{ background:url(../images/icons.png) 4px -314px no-repeat; width:22px; height:27px; display:block;} +a:hover.icon_page_add{ background:url(../images/icons.png) -16px -314px no-repeat;} +.tab_item02{ float:left; width:141px; height:30px;background:#eeeeee; margin-right:10px; padding:0 10px; margin-bottom:10px; padding:10px 0 0 15px;} +.tab_item02:hover{ background:#c9c9c9;} +.tab_icon{padding-left:25px;} +a:hover.tab_item02{ background:#fff;} +.icon_radio{background:url(../images/icons.png) 0px 0px no-repeat; } +.icon_checkbox{background:url(../images/icons.png) 0px -40px no-repeat; } +.icon_text{background:url(../images/icons.png) 0px -80px no-repeat; } +.icon_textarea{background:url(../images/icons.png) 0px -120px no-repeat; } + +.ur_editor {width:655px; border:1px solid #cbcbcb;background:#eeeeee; padding:10px; margin-bottom:10px;} +.ur_title_editor_title{ margin-bottom:10px;} +.input_title{ width:630px; height:40px; padding:0 10px; text-align:center; font-size:16px; font-weight:bold;} +.textarea_editor{ width:632px; height:120px; padding:10px; margin-bottom:10px;} +.btn_submit{ width:56px; height:24px; padding-top:4px;background:#15bccf; color:#fff; text-align:center; display:block; float:left; margin-right:10px;} +a:hover.btn_submit{background:#0fa9bb;} +.btn_cancel{width:54px; height:22px; padding-top:4px;background:#fff; color:#999; border:1px solid #999; text-align:center; display:block; float:left; } +a:hover.btn_cancel{ color:#666;} +.ur_question_title{ width:534px; height:30px; border:1px solid #cbcbcb; padding-left:5px; margin-right:10px;} +.ur_editor_title{ margin-bottom:10px;} +.ur_editor_content{ } +.ur_item{ margin-bottom:5px; height:32px; } +.ur_item input{ width:324px; height:30px;border:1px solid #cbcbcb; padding-left:5px; float:left; margin-right:10px; } +.ur_item label{ float:left;} +.icon_add{ background:url(../images/icons.png) 0px -310px no-repeat; width:16px; height:27px; display:block;float:left; margin-right:5px;} +a:hover.icon_add{background:url(../images/icons.png) -20px -310px no-repeat;} +.icon_remove{background:url(../images/icons.png) 0px -338px no-repeat; width:16px; height:27px; display:block;float:left;} +a:hover.icon_remove{background:url(../images/icons.png) -20px -338px no-repeat;} +.ur_editor_toolbar{ margin-bottom:10px;} +.ur_editor_toolbar input{ width:40px; height:20px;} +.ur_editor02{width:655px; border:1px solid #cbcbcb; padding:10px; margin-bottom:10px;} +a.ur_button_submit{ display:block; width:106px; height:37px; margin:0 auto; background:#15bccf; color:#fff; font-size:16px; text-align:center; padding-top:3px; margin-bottom:10px; } +a:hover.ur_button_submit{ background:#0fa9bb; text-decoration:none;} +a.ur_icon_de{ background:url(../images/icons.png) 0px -338px no-repeat; width:16px; height:27px; display:block;float:right; margin-top:15px;} +a:hover.ur_icon_de{ background:url(../images/icons.png) -20px -338px no-repeat;} +.ur_icon_edit{ background:url(../images/icons.png) 0px -272px no-repeat; width:16px; height:27px; display:block;float:right; margin-top:15px; margin-right:10px;} +a:hover.ur_icon_edit{ background:url(../images/icons.png) -21px -272px no-repeat;} From e59e9cd66141e4140515e88a63f7a1b296132374 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 13 Jan 2015 17:03:41 +0800 Subject: [PATCH 18/99] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E9=97=AE=E5=8D=B7=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/new.html.erb | 236 +++++++++++++++++++++++++++- public/stylesheets/images/icons.png | Bin 0 -> 2382 bytes 2 files changed, 235 insertions(+), 1 deletion(-) create mode 100644 public/stylesheets/images/icons.png diff --git a/app/views/poll/new.html.erb b/app/views/poll/new.html.erb index 9d07aa0df..85a4ab8e3 100644 --- a/app/views/poll/new.html.erb +++ b/app/views/poll/new.html.erb @@ -1 +1,235 @@ -111 \ No newline at end of file + + + + + 问卷调查_问卷编辑 + <%= stylesheet_link_tag 'polls', :media => 'all' %> + + + +
+ +
+ +
+
+ +
+
+ +
+
+ +
+ +
+
+ +
+
+
+ + + + +
+
+
    +
  • + + + + +
  • +
    +
  • + + + + +
  • +
    +
+
+ +
+
+
+
+
+ 第1题: 单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题 * +
+ + +
+
+ + + + + + + + + + + + +
+ +
+ +
+ +
+
+
+ +
+
+
+ + + + +
+
+
    +
  • + + + + +
  • +
    +
  • + + + + +
  • +
    +
+
+ +
+
+
+
+
+ 第2题: 多选题 * +
+ + +
+
+ + + + + + + + + + + + +
+ +
+ +
+ +
+
+
+ +
+
+ + + + +
+ +
+
+
+
+ 第3题: 单行文字 +
+ + +
+
+ +
+
+ + +
+
+ + + + +
+
+ + , + +
+ +
+
+
+
+
+ 第4题: 多行主观 +
+ + +
+
+ +
+
+
+ +
+ 提交 +
+
+ +
+ + diff --git a/public/stylesheets/images/icons.png b/public/stylesheets/images/icons.png new file mode 100644 index 0000000000000000000000000000000000000000..2d2b33fe1a24f741e781b935549f8172180870ad GIT binary patch literal 2382 zcmZ`*3pA8l8{VHWqG)o7C9r0BG?5d|Mar z6ae8y08IM>V3h@cTu7Q<(*XcPdvOl-CnAStbN!wudMdrPV|YE4Jn|@OBmujK`<;Mu zxJ@@p<%H{>OElK>Pq;RsM@f0&zU5RV*2|HrZ7AL#3effFNye*YNm~Wfym_72@`neJHLtBX5s`ccOby$7Sx^S+`hO#yY z1E_T?$Ke3Dz)bSkUt| z+;RNG=zjN(rV`4K6(K$_%op0Su`}#_% z^>m}{bXGNlbZ9@talLX+i$4uE4_-C#vHg`}g6GarG@XRWX#qxW+i0iy;_bo;WF_(c zcJN2wHxoKHz#W5lFA5lCCXMQP^4iel{D z3y&vuvAm_x>2+3+%-;V4ct(~yp|IzUd9G*H1?EXyu^JTmN1pM4>R$jfja%IjWx)z) z<{scTGDq#-nL0kQY%)EioPtaBiJ+DDX#Cu#!2CG0vuIz@3Cr-kMZGRXCk)DV7Ev<9 z*jf!KOeSL5vwhTH;kM9N|{tf*r7I#GwD_?$piKMt;10G&6dH+Cx))^JvAe5(Db2}Ku z(2hnD^U%J}U$aou+Aq#9MCUh|fB|#qxvbTcu=zmbdH+hGoQ#S{o^a*h)3CtCZ_3dO zB~Qu4gBATpwH@Z|5w@vTPywuK+HNxquNjDSTw2vtIMJ0AU9k((FD=FUBL6IAGrL_` z#r2SquKIAIX`j0ZqxVrnX}Z;PVJ7Ab`)hp1Cs#VZxJ5bMuL7lvY%c2ko<22~-&2RU@Y;D@d};d7RFZl?i0GIvPl~5c-7lH(3jW^REI8RtSQaruG|0z- z=`Cj;J>#hC{ zLX|UTScy*X8e#nOV89kZLL}`(zoZ!Z-31>V>x3H`h>RtzMFZJBvu?2XpJHr@uwsU~ zsk7cG`6)t=Gi+uZgBCAwuhK*=Gb9(YlkyK^Hsj#J)^mN%usK~E2h09$s4hkJlAN8i zzj=p7OmoSg3A(NnNJBOJwK2*1&{B4iXY2G>yFP?cmoiG#`9b7{!N{kx1|n?Eh@wwh zD^FIi1d^3i|ESX$hAw-CZS8El?pJlXsS!6GuK zKz=4A#>9Y|+U`*j9_9+OK*$-q)MafR-+0u#;{I0Nepn^8!MGIu9wyE{Y|a4nt(DXo zyy3di@@}$tWTC1LAzJ|&fpQ4=!`09-J%$@B_bF;rinu*s-mKZDW#h7I&CM%%yg;N5 zj)6OEB(yO;q-?&hHv<-$S=9o5Xl(0qsq75~U5|~mx(JGhEo?{|pz@Cnt*DW&5m#tO zkk`i7^O$!iRlw)zk$|@MrN@U)DL8UYkG!vsBmZV@5f=spi_6e0nrfY!5UN(xsGFd+ z$zUQ-f$E{?o;?vhN$9A?9blN9%zDJjmW347VWKHi)Ue3NMQ#XWnD`-6v5{7cld0_IKIfVMo`C33gQL6?e5 zorWXGn%4j7*#?%-0_vW=lOngA$S`}A?aK(VA45zyCC1B^BhD}# zTZoD%AuK;uBG2*F*HraA&8r&^8Y{4lUy_<@a*WvNFV4k_ zW5pEZ@f|36l*MU7y)$p7E>bicgTvQ8h~muGr^RWA6fhn=d}7J zHL_m#9sZn*`lj~i9XDAo`0H5h_+CQ!(mDk6uNQX3y-ao&{DlC{(Z%7}KL5DC0Rml0 AWB>pF literal 0 HcmV?d00001 From 0a9509a9211433c66e8f4b2401c224d3f5f33365 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 13 Jan 2015 17:54:19 +0800 Subject: [PATCH 19/99] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=97=AE=E5=8D=B7?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/new.html.erb | 2 +- public/stylesheets/polls.css | 34 +++++++++---------- .../stylesheets/application.css | 4 +-- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/app/views/poll/new.html.erb b/app/views/poll/new.html.erb index 85a4ab8e3..b182f4a29 100644 --- a/app/views/poll/new.html.erb +++ b/app/views/poll/new.html.erb @@ -9,7 +9,7 @@
-
+
  • 单选题 diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css index 99e88c98d..fe8af280f 100644 --- a/public/stylesheets/polls.css +++ b/public/stylesheets/polls.css @@ -1,5 +1,5 @@ /* CSS Document */ -#polls{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff; font-style:normal;} +#polls{ font-size:12px; font-family:"微软雅黑","宋体" !important; 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;} #polls div,img,tr,td{ border:0;} #polls table,tr,td{border:0; cellspacing:0; cellpadding:0;} @@ -69,22 +69,22 @@ a:hover.ur_button{ background:#0fa9bb; text-decoration:none;} /*问卷编辑*/ .polls_edit{ color:#767676;} a:hover{ text-decoration:none; cursor:pointer;} -.tabs{ width:665px; height: auto; border:1px solid #cbcbcb; padding:10px 0 0 10px; margin-bottom:10px;} +.tabs_1{ width:665px; height: auto; border:1px solid #cbcbcb; padding:10px 0 0 10px; margin-bottom:10px;} .tab_item { float:left; height:30px; background:#eeeeee; margin-right:4px; padding:0 8px; margin-bottom:10px;} .icon_delete{ font-size:16px;} a:hover.icon_delete{ font-weight: bold;} .current{ color:#4f4f4d; background:#c4c4c4;} .tab_add{float:left; width:22px; height:22px; border:1px solid #cbcbcb; margin-top:6px; } -.icon_page_add{ background:url(../images/icons.png) 4px -314px no-repeat; width:22px; height:27px; display:block;} -a:hover.icon_page_add{ background:url(../images/icons.png) -16px -314px no-repeat;} +.icon_page_add{ background:url(images/icons.png) 4px -314px no-repeat; width:22px; height:27px; display:block;} +a:hover.icon_page_add{ background:url(images/icons.png) -16px -314px no-repeat;} .tab_item02{ float:left; width:141px; height:30px;background:#eeeeee; margin-right:10px; padding:0 10px; margin-bottom:10px; padding:10px 0 0 15px;} .tab_item02:hover{ background:#c9c9c9;} .tab_icon{padding-left:25px;} a:hover.tab_item02{ background:#fff;} -.icon_radio{background:url(../images/icons.png) 0px 0px no-repeat; } -.icon_checkbox{background:url(../images/icons.png) 0px -40px no-repeat; } -.icon_text{background:url(../images/icons.png) 0px -80px no-repeat; } -.icon_textarea{background:url(../images/icons.png) 0px -120px no-repeat; } +.icon_radio{background:url(images/icons.png) 0px 0px no-repeat;color: gray; padding-bottom: 5px;} +.icon_checkbox{background:url(images/icons.png) 0px -40px no-repeat;color: gray; padding-bottom: 5px;} +.icon_text{background:url(images/icons.png) 0px -80px no-repeat;color: gray; padding-bottom: 5px;} +.icon_textarea{background:url(images/icons.png) 0px -120px no-repeat; color: gray;padding-bottom: 5px;} .ur_editor {width:655px; border:1px solid #cbcbcb;background:#eeeeee; padding:10px; margin-bottom:10px;} .ur_title_editor_title{ margin-bottom:10px;} @@ -98,18 +98,18 @@ a:hover.btn_cancel{ color:#666;} .ur_editor_title{ margin-bottom:10px;} .ur_editor_content{ } .ur_item{ margin-bottom:5px; height:32px; } -.ur_item input{ width:324px; height:30px;border:1px solid #cbcbcb; padding-left:5px; float:left; margin-right:10px; } +.ur_item input{ width:324px; height:30px;border:1px solid #cbcbcb; padding:0 5px; float:left; margin-right:10px; } .ur_item label{ float:left;} -.icon_add{ background:url(../images/icons.png) 0px -310px no-repeat; width:16px; height:27px; display:block;float:left; margin-right:5px;} -a:hover.icon_add{background:url(../images/icons.png) -20px -310px no-repeat;} -.icon_remove{background:url(../images/icons.png) 0px -338px no-repeat; width:16px; height:27px; display:block;float:left;} -a:hover.icon_remove{background:url(../images/icons.png) -20px -338px no-repeat;} +.icon_add{ background:url(images/icons.png) 0px -310px no-repeat; width:16px; height:27px; display:block;float:left; margin-right:5px;} +a:hover.icon_add{background:url(images/icons.png) -20px -310px no-repeat;} +.icon_remove{background:url(images/icons.png) 0px -338px no-repeat; width:16px; height:27px; display:block;float:left;} +a:hover.icon_remove{background:url(images/icons.png) -20px -338px no-repeat;} .ur_editor_toolbar{ margin-bottom:10px;} .ur_editor_toolbar input{ width:40px; height:20px;} .ur_editor02{width:655px; border:1px solid #cbcbcb; padding:10px; margin-bottom:10px;} a.ur_button_submit{ display:block; width:106px; height:37px; margin:0 auto; background:#15bccf; color:#fff; font-size:16px; text-align:center; padding-top:3px; margin-bottom:10px; } a:hover.ur_button_submit{ background:#0fa9bb; text-decoration:none;} -a.ur_icon_de{ background:url(../images/icons.png) 0px -338px no-repeat; width:16px; height:27px; display:block;float:right; margin-top:15px;} -a:hover.ur_icon_de{ background:url(../images/icons.png) -20px -338px no-repeat;} -.ur_icon_edit{ background:url(../images/icons.png) 0px -272px no-repeat; width:16px; height:27px; display:block;float:right; margin-top:15px; margin-right:10px;} -a:hover.ur_icon_edit{ background:url(../images/icons.png) -21px -272px no-repeat;} +a.ur_icon_de{ background:url(images/icons.png) 0px -338px no-repeat; width:16px; height:27px; display:block;float:right; margin-top:15px;} +a:hover.ur_icon_de{ background:url(images/icons.png) -20px -338px no-repeat;} +.ur_icon_edit{ background:url(images/icons.png) 0px -272px no-repeat; width:16px; height:27px; display:block;float:right; margin-top:15px; margin-right:10px;} +a:hover.ur_icon_edit{ background:url(images/icons.png) -21px -272px no-repeat;} diff --git a/public/themes/redpenny-master/stylesheets/application.css b/public/themes/redpenny-master/stylesheets/application.css index e10c5a91b..897434393 100644 --- a/public/themes/redpenny-master/stylesheets/application.css +++ b/public/themes/redpenny-master/stylesheets/application.css @@ -851,8 +851,8 @@ p.breadcrumb input[type="text"],input[type="password"],textarea,select { - padding:2px; - border:1px solid #039ea0 + #padding:2px; + #border:1px solid #039ea0 } input[type="text"],input[type="password"] From ac7c0081d5189fb4d987af8b542aafda46b5ae66 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 13 Jan 2015 18:06:02 +0800 Subject: [PATCH 20/99] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E9=A2=98=E6=A0=87=E9=A2=98input=E8=BF=87=E5=AE=BD?= 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 fe8af280f..428ade808 100644 --- a/public/stylesheets/polls.css +++ b/public/stylesheets/polls.css @@ -94,7 +94,7 @@ a:hover.tab_item02{ background:#fff;} a:hover.btn_submit{background:#0fa9bb;} .btn_cancel{width:54px; height:22px; padding-top:4px;background:#fff; color:#999; border:1px solid #999; text-align:center; display:block; float:left; } a:hover.btn_cancel{ color:#666;} -.ur_question_title{ width:534px; height:30px; border:1px solid #cbcbcb; padding-left:5px; margin-right:10px;} +.ur_question_title{ width:534px; height:30px; border:1px solid #cbcbcb; padding:0 5px !important; margin-right:10px;} .ur_editor_title{ margin-bottom:10px;} .ur_editor_content{ } .ur_item{ margin-bottom:5px; height:32px; } From c84b8f75cc85960f9e72fcb744d8a723d7547fc6 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 13 Jan 2015 18:21:46 +0800 Subject: [PATCH 21/99] =?UTF-8?q?=E7=BC=96=E8=BE=91=E9=97=AE=E5=8D=B7?= =?UTF-8?q?=E7=9A=84=E9=A1=B5=E9=9D=A2=E7=9A=84=E5=88=86=E5=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/_edit_MC.html.erb | 33 +++++ app/views/poll/_edit_MCQ.html.erb | 33 +++++ app/views/poll/_edit_mulit.html.erb | 18 +++ app/views/poll/_edit_single.html.erb | 13 ++ app/views/poll/_show_MC.html.erb | 29 +++++ app/views/poll/_show_MCQ.html.erb | 29 +++++ app/views/poll/_show_mulit.html.erb | 13 ++ app/views/poll/_show_single.html.erb | 11 ++ app/views/poll/new.html.erb | 184 --------------------------- 9 files changed, 179 insertions(+), 184 deletions(-) create mode 100644 app/views/poll/_edit_MC.html.erb create mode 100644 app/views/poll/_edit_MCQ.html.erb create mode 100644 app/views/poll/_edit_mulit.html.erb create mode 100644 app/views/poll/_edit_single.html.erb create mode 100644 app/views/poll/_show_MC.html.erb create mode 100644 app/views/poll/_show_MCQ.html.erb create mode 100644 app/views/poll/_show_mulit.html.erb create mode 100644 app/views/poll/_show_single.html.erb diff --git a/app/views/poll/_edit_MC.html.erb b/app/views/poll/_edit_MC.html.erb new file mode 100644 index 000000000..fb94bc7c8 --- /dev/null +++ b/app/views/poll/_edit_MC.html.erb @@ -0,0 +1,33 @@ +
    +
    +
    + + + + +
    +
    +
      +
    • + + + + +
    • +
      +
    • + + + + +
    • +
      +
    +
    + +
    +
    +
    \ No newline at end of file diff --git a/app/views/poll/_edit_MCQ.html.erb b/app/views/poll/_edit_MCQ.html.erb new file mode 100644 index 000000000..1d221c144 --- /dev/null +++ b/app/views/poll/_edit_MCQ.html.erb @@ -0,0 +1,33 @@ +
    +
    +
    + + + + +
    +
    +
      +
    • + + + + +
    • +
      +
    • + + + + +
    • +
      +
    +
    + +
    +
    +
    \ No newline at end of file diff --git a/app/views/poll/_edit_mulit.html.erb b/app/views/poll/_edit_mulit.html.erb new file mode 100644 index 000000000..bab897489 --- /dev/null +++ b/app/views/poll/_edit_mulit.html.erb @@ -0,0 +1,18 @@ +
    +
    + + + + +
    +
    + + , + +
    + +
    +
    \ No newline at end of file diff --git a/app/views/poll/_edit_single.html.erb b/app/views/poll/_edit_single.html.erb new file mode 100644 index 000000000..73f22c2cd --- /dev/null +++ b/app/views/poll/_edit_single.html.erb @@ -0,0 +1,13 @@ +
    +
    + + + + +
    + +
    +
    \ No newline at end of file diff --git a/app/views/poll/_show_MC.html.erb b/app/views/poll/_show_MC.html.erb new file mode 100644 index 000000000..c647582ca --- /dev/null +++ b/app/views/poll/_show_MC.html.erb @@ -0,0 +1,29 @@ +
    +
    + 第1题: 单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题 * +
    + + +
    +
    + + + + + + + + + + + + +
    + +
    + +
    + +
    +
    +
    \ No newline at end of file diff --git a/app/views/poll/_show_MCQ.html.erb b/app/views/poll/_show_MCQ.html.erb new file mode 100644 index 000000000..e56de53b9 --- /dev/null +++ b/app/views/poll/_show_MCQ.html.erb @@ -0,0 +1,29 @@ +
    +
    + 第2题: 多选题 * +
    + + +
    +
    + + + + + + + + + + + + +
    + +
    + +
    + +
    +
    +
    \ No newline at end of file diff --git a/app/views/poll/_show_mulit.html.erb b/app/views/poll/_show_mulit.html.erb new file mode 100644 index 000000000..35e37ef06 --- /dev/null +++ b/app/views/poll/_show_mulit.html.erb @@ -0,0 +1,13 @@ +
    +
    +
    + 第4题: 多行主观 +
    + + +
    +
    + +
    +
    +
    \ No newline at end of file diff --git a/app/views/poll/_show_single.html.erb b/app/views/poll/_show_single.html.erb new file mode 100644 index 000000000..437e38044 --- /dev/null +++ b/app/views/poll/_show_single.html.erb @@ -0,0 +1,11 @@ +
    +
    + 第3题: 单行文字 +
    + + +
    +
    + +
    +
    \ No newline at end of file diff --git a/app/views/poll/new.html.erb b/app/views/poll/new.html.erb index b182f4a29..8f3cde9da 100644 --- a/app/views/poll/new.html.erb +++ b/app/views/poll/new.html.erb @@ -41,190 +41,6 @@
-
-
-
- - - - -
-
-
    -
  • - - - - -
  • -
    -
  • - - - - -
  • -
    -
-
- -
-
-
-
-
- 第1题: 单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题单选题 * -
- - -
-
- - - - - - - - - - - - -
- -
- -
- -
-
-
- -
-
-
- - - - -
-
-
    -
  • - - - - -
  • -
    -
  • - - - - -
  • -
    -
-
- -
-
-
-
-
- 第2题: 多选题 * -
- - -
-
- - - - - - - - - - - - -
- -
- -
- -
-
-
- -
-
- - - - -
- -
-
-
-
- 第3题: 单行文字 -
- - -
-
- -
-
- - -
-
- - - - -
-
- - , - -
- -
-
-
-
-
- 第4题: 多行主观 -
- - -
-
- -
-
-
- From 311d90d56520c4f588183c123be35578da1a2841 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 13 Jan 2015 20:13:50 +0800 Subject: [PATCH 22/99] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E5=8D=95=E9=80=89=E3=80=81=E5=A4=9A=E9=80=89=E3=80=81=E5=8D=95?= =?UTF-8?q?=E8=A1=8C=E6=96=87=E6=9C=AC=E3=80=81=E5=A4=9A=E8=A1=8C=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E7=9A=84js=202.=E5=88=86=E5=89=B2=E9=97=AE=E5=8D=B7?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E5=A4=B4=203.=E5=A2=9E=E5=8A=A0=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E9=97=AE=E9=A2=98=E7=9A=84=E8=B7=AF=E7=94=B1=E5=8F=8A?= =?UTF-8?q?action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 5 ++++ app/views/poll/_edit_MCQ.html.erb | 2 +- app/views/poll/_edit_head.html.erb | 13 +++++++++ app/views/poll/new.html.erb | 44 ++++++++++++++++++------------ config/locales/zh.yml | 5 ++++ config/routes.rb | 1 + 6 files changed, 51 insertions(+), 19 deletions(-) create mode 100644 app/views/poll/_edit_head.html.erb diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index e5b1025a4..9177e044b 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -81,6 +81,11 @@ class PollController < ApplicationController end end + #添加单选题 + def add_mc + + end + private def find_poll_and_course @poll = Poll.find params[:id] diff --git a/app/views/poll/_edit_MCQ.html.erb b/app/views/poll/_edit_MCQ.html.erb index 1d221c144..b97bba776 100644 --- a/app/views/poll/_edit_MCQ.html.erb +++ b/app/views/poll/_edit_MCQ.html.erb @@ -2,7 +2,7 @@
- +
diff --git a/app/views/poll/_edit_head.html.erb b/app/views/poll/_edit_head.html.erb new file mode 100644 index 000000000..6c8294e99 --- /dev/null +++ b/app/views/poll/_edit_head.html.erb @@ -0,0 +1,13 @@ +
+
+ +
+
+ +
+ +
+
\ No newline at end of file diff --git a/app/views/poll/new.html.erb b/app/views/poll/new.html.erb index 8f3cde9da..06ef2fae8 100644 --- a/app/views/poll/new.html.erb +++ b/app/views/poll/new.html.erb @@ -4,6 +4,13 @@ 问卷调查_问卷编辑 <%= stylesheet_link_tag 'polls', :media => 'all' %> + + @@ -12,37 +19,38 @@ -
-
- -
-
- -
- -
-
+<%= render :partial => 'edit_head'%> + +
+
diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 7c93f8e98..d130cc666 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2245,4 +2245,9 @@ zh: label_poll: 问卷调查 label_new_poll: 新建问卷 label_statistical_results: 统计结果 + label_MC: 单选题 + label_MCQ: 多选题 + label_single: 单行文字 + label_mulit: 多行文字 + diff --git a/config/routes.rb b/config/routes.rb index 617a5ade4..af0b75ae7 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -61,6 +61,7 @@ RedmineApp::Application.routes.draw do resources :poll do member do get 'statistics_result' + get 'add_mc' end end From 85542095a64b3e80e0f0b172ce466c227b693491 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 13 Jan 2015 20:20:28 +0800 Subject: [PATCH 23/99] =?UTF-8?q?=E5=A2=9E=E5=8A=A0input=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E6=97=B6=E7=9A=84=E6=8F=90=E7=A4=BA=EF=BC=8C=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E9=83=A8=E5=88=86html=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/_edit_MC.html.erb | 8 ++++---- app/views/poll/_edit_MCQ.html.erb | 8 ++++---- app/views/poll/_edit_mulit.html.erb | 4 ++-- app/views/poll/_edit_single.html.erb | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/views/poll/_edit_MC.html.erb b/app/views/poll/_edit_MC.html.erb index fb94bc7c8..823247a6e 100644 --- a/app/views/poll/_edit_MC.html.erb +++ b/app/views/poll/_edit_MC.html.erb @@ -2,22 +2,22 @@
- - + +
  • - +
  • - +
  • diff --git a/app/views/poll/_edit_MCQ.html.erb b/app/views/poll/_edit_MCQ.html.erb index b97bba776..3a2ad9cec 100644 --- a/app/views/poll/_edit_MCQ.html.erb +++ b/app/views/poll/_edit_MCQ.html.erb @@ -2,22 +2,22 @@
    - - + +
    • - +
    • - +
    • diff --git a/app/views/poll/_edit_mulit.html.erb b/app/views/poll/_edit_mulit.html.erb index bab897489..13bf232a7 100644 --- a/app/views/poll/_edit_mulit.html.erb +++ b/app/views/poll/_edit_mulit.html.erb @@ -1,8 +1,8 @@
      - - + +
      diff --git a/app/views/poll/_edit_single.html.erb b/app/views/poll/_edit_single.html.erb index 73f22c2cd..764b6bbb3 100644 --- a/app/views/poll/_edit_single.html.erb +++ b/app/views/poll/_edit_single.html.erb @@ -1,8 +1,8 @@
      - - + +
    - 提交 + <%= link_to "提交",commit_poll_poll_path(@poll), :method => :post,:class => "ur_button",:format => 'js',:remote=>true %>
    答题已完成 0%
    diff --git a/config/routes.rb b/config/routes.rb index 28aa7452c..2f1414a48 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -63,6 +63,7 @@ RedmineApp::Application.routes.draw do get 'statistics_result' post 'commit_answer' post 'create_poll_question' + post 'commit_poll' end end From d55492b07a183410dbbc05f2d1e264e7fd047f22 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 15 Jan 2015 18:17:45 +0800 Subject: [PATCH 49/99] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=8D=95=E9=80=89=E9=A2=98=E7=9A=84=E8=B7=AF=E7=94=B1=E3=80=81?= =?UTF-8?q?action=E3=80=81=E4=BB=A5=E5=8F=8Ajs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 7 ++- app/views/poll/_edit_MC.html.erb | 58 +++++++++++----------- app/views/poll/update_poll_question.js.erb | 0 config/routes.rb | 2 +- 4 files changed, 35 insertions(+), 32 deletions(-) create mode 100644 app/views/poll/update_poll_question.js.erb diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 48b1af43a..e94b0f132 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -114,7 +114,12 @@ class PollController < ApplicationController #修改单选题 def update_poll_question - a = 1 + @poll_question = PollQuestion.find params[:poll_question] + @poll = @poll_question.poll + + respond_to do |format| + format.js + end end #删除单选题 diff --git a/app/views/poll/_edit_MC.html.erb b/app/views/poll/_edit_MC.html.erb index 6010132fb..fa0e8d802 100644 --- a/app/views/poll/_edit_MC.html.erb +++ b/app/views/poll/_edit_MC.html.erb @@ -1,33 +1,31 @@ -<%= form_for poll_question,:url =>update_poll_question_poll_path(@poll.id),:remote => true do |f|%> -
    - -
    -
    - - - - /> - -
    -
    -
      - <% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %> -
    • - - - - -
    • -
      - <% end%> -
    -
    - -
    +<%= form_for(poll_question,:url => update_poll_question_poll_index_path(:poll_question => poll_question.id),:remote => true) do |f|%> + +
    +
    + + + + /> +
    - +
    +
      + <% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %> +
    • + + + + +
    • +
      + <% end%> +
    +
    + +
    + <% end%> \ No newline at end of file diff --git a/app/views/poll/update_poll_question.js.erb b/app/views/poll/update_poll_question.js.erb new file mode 100644 index 000000000..e69de29bb diff --git a/config/routes.rb b/config/routes.rb index 14f23b5f4..e089e8420 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -62,10 +62,10 @@ RedmineApp::Application.routes.draw do member do get 'statistics_result' post 'create_poll_question' - post 'update_poll_question' end collection do delete 'delete_poll_question' + post 'update_poll_question' end end From e44cc07f86af53431e890bd36e1442e695df4cba Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 15 Jan 2015 18:22:30 +0800 Subject: [PATCH 50/99] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=97=AE=E5=8D=B7?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 5 +++- app/views/poll/_commit_alert.html.erb | 37 +++++++++++++++++++++++++-- app/views/poll/commit_poll.js.erb | 7 +++-- app/views/poll/show.html.erb | 3 +++ 4 files changed, 45 insertions(+), 7 deletions(-) diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 531cff906..cec9b3a34 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -180,9 +180,12 @@ class PollController < ApplicationController pu.poll_id = @poll.id if pu.save #redirect_to poll_index_path(:polls_group_id => @course.id,:polls_type => 'Course') + @status = 0 #提交成功 + else + @status = 2 #未知错误 end else - + @status = 1 #有未做得必答题 end respond_to do |format| format.js diff --git a/app/views/poll/_commit_alert.html.erb b/app/views/poll/_commit_alert.html.erb index 007ae5ba7..46982006c 100644 --- a/app/views/poll/_commit_alert.html.erb +++ b/app/views/poll/_commit_alert.html.erb @@ -1,3 +1,36 @@ -
    - shaksdkfdks +
    + <% if status == 0 %> +

    提交成功!

    + <%= link_to "确定", poll_index_path(:polls_group_id => @course.id,:polls_type => 'Course'),:style => 'height: 28px; +display: block; +width: 80px; +color: #fff; +background: #15bccf; +text-align: center; +padding-top: 4px; +float: left; +margin-right: 10px;'%> + <% elsif status == 1 %> +

    您还有尚未作答的题目请完成后在提交!

    + <%= link_to "确定", "javascript:void(0)",:onclick => 'hidden_atert_form();',:style => 'height: 28px; +display: block; +width: 80px; +color: #fff; +background: #15bccf; +text-align: center; +padding-top: 4px; +float: left; +margin-right: 10px;'%> + <% else %> +

    发生未知错误,请检查您的网络。

    + <%= link_to "确定", "javascript:void(0)",:onclick => 'hidden_atert_form();',:style => 'height: 28px; +display: block; +width: 80px; +color: #fff; +background: #15bccf; +text-align: center; +padding-top: 4px; +float: left; +margin-right: 10px;'%> + <% end %>
    diff --git a/app/views/poll/commit_poll.js.erb b/app/views/poll/commit_poll.js.erb index e0b9960b9..185967513 100644 --- a/app/views/poll/commit_poll.js.erb +++ b/app/views/poll/commit_poll.js.erb @@ -1,10 +1,9 @@ -$('#ajax-modal').html('<%= escape_javascript(render :partial => 'commit_alert') %>'); +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'commit_alert',:locals => {:status => @status}) %>'); showModal('ajax-modal', '513px'); $('#ajax-modal').css('height','200px'); $('#ajax-modal').siblings().remove(); -$('#ajax-modal').before("" + +$('#ajax-modal').before("" + ""); $('#ajax-modal').parent().removeClass("alert_praise"); -$('#ajax-modal').parent().css("top","50%").css("left","20%"); -$('#ajax-modal').parent().css("position","absolute"); +$('#ajax-modal').parent().css("top","").css("left",""); $('#ajax-modal').parent().addClass("alert_box"); \ No newline at end of file diff --git a/app/views/poll/show.html.erb b/app/views/poll/show.html.erb index 2db65ec97..4f9bc75aa 100644 --- a/app/views/poll/show.html.erb +++ b/app/views/poll/show.html.erb @@ -4,6 +4,9 @@ 问卷调查_问卷页面 <%= stylesheet_link_tag 'polls', :media => 'all' %> + - <%= radio_button "poll_vote","poll_answer_id",pa.id,:class=>"ur_radio",:onclick =>"click_#{pa.id}(this);return false;",:checked => answer_be_selected?(pa,User.current) %> + <%= radio_button "poll_vote","poll_answer_id",pa.id,:class=>"ur_radio",:onclick =>"click_#{pa.id}(this);return false;",:checked => answer_be_selected?(pa,User.current),:disabled => !@can_edit_poll %> <%= pa.answer_text %> @@ -130,7 +130,7 @@ }); } - > + <%= @can_edit_poll?"":"disabled=disabled" %> > <%= pa.answer_text %> @@ -171,7 +171,7 @@ } - + >
    <% elsif pq.question_type == 4 %> @@ -203,7 +203,7 @@ }); } -
    <%= get_anwser_vote_text(pq.id,User.current.id) %>
    +
    " onblur="onblur_<%= pq.id %>(this);"><%= get_anwser_vote_text(pq.id,User.current.id) %>
    diff --git a/public/plugin_assets/redmine_code_review/stylesheets/window_js/mac_os_x_dialog.css b/public/plugin_assets/redmine_code_review/stylesheets/window_js/mac_os_x_dialog.css index 4c89f602d..e663e3c5e 100644 --- a/public/plugin_assets/redmine_code_review/stylesheets/window_js/mac_os_x_dialog.css +++ b/public/plugin_assets/redmine_code_review/stylesheets/window_js/mac_os_x_dialog.css @@ -1,160 +1,160 @@ -.overlay_mac_os_x_dialog { - background-color: #FF7224; - filter:alpha(opacity=60); - -moz-opacity: 0.6; - opacity: 0.6; -} - -.mac_os_x_dialog_nw { - background: transparent url(mac_os_x_dialog/L.png) repeat-y top left; - width:16px; - height:16px; -} - -.mac_os_x_dialog_n { - background: transparent url(mac_os_x_dialog/bg.gif) repeat 0 0; - height:18px; -} - -.mac_os_x_dialog_ne { - background: transparent url(mac_os_x_dialog/R.png) repeat-y top left; - width:16px; - height:16px; -} - -.mac_os_x_dialog_w { - background: transparent url(mac_os_x_dialog/L.png) repeat-y top left; - width:16px; -} - -.mac_os_x_dialog_e { - background: transparent url(mac_os_x_dialog/R.png) repeat-y top right; - width:16px; -} - -.mac_os_x_dialog_sw { - background: transparent url(mac_os_x_dialog/BL.png) no-repeat 0 0; - width:31px; - height:40px; -} - -.mac_os_x_dialog_s { - background: transparent url(mac_os_x_dialog/B.png) repeat-x 0 0; - height:40px; -} - -.mac_os_x_dialog_se, .mac_os_x_dialog_sizer { - background: transparent url(mac_os_x_dialog/BR.png) no-repeat 0 0; - width:31px; - height:40px; -} - -.mac_os_x_dialog_sizer { - cursor:se-resize; -} - -.mac_os_x_dialog_close { - width: 19px; - height: 19px; - background: transparent url(mac_os_x_dialog/close.gif) no-repeat 0 0; - position:absolute; - top:12px; - left:25px; - cursor:pointer; - z-index:1000; -} - -.mac_os_x_dialog_minimize { - width: 19px; - height: 19px; - background: transparent url(mac_os_x_dialog/minimize.gif) no-repeat 0 0; - position:absolute; - top:12px; - left:45px; - cursor:pointer; - z-index:1000; -} - -.mac_os_x_dialog_maximize { - width: 19px; - height: 19px; - background: transparent url(mac_os_x_dialog/maximize.gif) no-repeat 0 0; - position:absolute; - top:12px; - left:65px; - cursor:pointer; - z-index:1000; -} - -.mac_os_x_dialog_title { - float:left; - height:14px; - font-family: Tahoma, Arial, sans-serif; - font-size:12px; - text-align:center; - margin-top:6px; - width:100%; - color:#000; -} - -.mac_os_x_dialog_content { - overflow:auto; - color: #222; - font-family: Tahoma, Arial, sans-serif; - font-size: 10px; - background: transparent url(mac_os_x_dialog/bg.gif) repeat 0 0; -} - -.mac_os_x_dialog_buttons { - text-align: center; -} -/* FOR IE */ -* html .mac_os_x_dialog_nw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/L.png", sizingMethod="scale"); -} - - -* html .mac_os_x_dialog_ne { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/R.png", sizingMethod="scale"); -} - -* html .mac_os_x_dialog_w { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/L.png", sizingMethod="scale"); -} - -* html .mac_os_x_dialog_e { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/R.png", sizingMethod="scale"); -} - -* html .mac_os_x_dialog_sw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BL.png", sizingMethod="crop"); -} - -* html .mac_os_x_dialog_s { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/B.png", sizingMethod="scale"); -} - -* html .mac_os_x_dialog_se { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BR.png", sizingMethod="crop"); -} - -* html .mac_os_x_dialog_sizer { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BR.png", sizingMethod="crop"); -} - +.overlay_mac_os_x_dialog { + background-color: #FF7224; + filter:alpha(opacity=60); + -moz-opacity: 0.6; + opacity: 0.6; +} + +.mac_os_x_dialog_nw { + background: transparent url(mac_os_x_dialog/L.png) repeat-y top left; + width:16px; + height:16px; +} + +.mac_os_x_dialog_n { + background: transparent url(mac_os_x_dialog/bg.gif) repeat 0 0; + height:18px; +} + +.mac_os_x_dialog_ne { + background: transparent url(mac_os_x_dialog/R.png) repeat-y top left; + width:16px; + height:16px; +} + +.mac_os_x_dialog_w { + background: transparent url(mac_os_x_dialog/L.png) repeat-y top left; + width:16px; +} + +.mac_os_x_dialog_e { + background: transparent url(mac_os_x_dialog/R.png) repeat-y top right; + width:16px; +} + +.mac_os_x_dialog_sw { + background: transparent url(mac_os_x_dialog/BL.png) no-repeat 0 0; + width:31px; + height:40px; +} + +.mac_os_x_dialog_s { + background: transparent url(mac_os_x_dialog/B.png) repeat-x 0 0; + height:40px; +} + +.mac_os_x_dialog_se, .mac_os_x_dialog_sizer { + background: transparent url(mac_os_x_dialog/BR.png) no-repeat 0 0; + width:31px; + height:40px; +} + +.mac_os_x_dialog_sizer { + cursor:se-resize; +} + +.mac_os_x_dialog_close { + width: 19px; + height: 19px; + background: transparent url(mac_os_x_dialog/close.gif) no-repeat 0 0; + position:absolute; + top:12px; + left:25px; + cursor:pointer; + z-index:1000; +} + +.mac_os_x_dialog_minimize { + width: 19px; + height: 19px; + background: transparent url(mac_os_x_dialog/minimize.gif) no-repeat 0 0; + position:absolute; + top:12px; + left:45px; + cursor:pointer; + z-index:1000; +} + +.mac_os_x_dialog_maximize { + width: 19px; + height: 19px; + background: transparent url(mac_os_x_dialog/maximize.gif) no-repeat 0 0; + position:absolute; + top:12px; + left:65px; + cursor:pointer; + z-index:1000; +} + +.mac_os_x_dialog_title { + float:left; + height:14px; + font-family: Tahoma, Arial, sans-serif; + font-size:12px; + text-align:center; + margin-top:6px; + width:100%; + color:#000; +} + +.mac_os_x_dialog_content { + overflow:auto; + color: #222; + font-family: Tahoma, Arial, sans-serif; + font-size: 10px; + background: transparent url(mac_os_x_dialog/bg.gif) repeat 0 0; +} + +.mac_os_x_dialog_buttons { + text-align: center; +} +/* FOR IE */ +* html .mac_os_x_dialog_nw { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/L.png", sizingMethod="scale"); +} + + +* html .mac_os_x_dialog_ne { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/R.png", sizingMethod="scale"); +} + +* html .mac_os_x_dialog_w { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/L.png", sizingMethod="scale"); +} + +* html .mac_os_x_dialog_e { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/R.png", sizingMethod="scale"); +} + +* html .mac_os_x_dialog_sw { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BL.png", sizingMethod="crop"); +} + +* html .mac_os_x_dialog_s { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/B.png", sizingMethod="scale"); +} + +* html .mac_os_x_dialog_se { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BR.png", sizingMethod="crop"); +} + +* html .mac_os_x_dialog_sizer { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BR.png", sizingMethod="crop"); +} + diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css index b13cb1da2..e89e50be4 100644 --- a/public/stylesheets/polls.css +++ b/public/stylesheets/polls.css @@ -27,6 +27,7 @@ a.newbtn{ float:right; display:block; width:80px; height:30px; background:#64bdd 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;} +.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;} From 9fb0275563b12d3416662f35a7e9b71bbc478724 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 16 Jan 2015 10:43:05 +0800 Subject: [PATCH 54/99] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=8D=95=E9=80=89=E9=A2=98=E6=97=B6=E9=A1=B5=E9=9D=A2js?= =?UTF-8?q?=E7=9A=84=E5=88=B7=E6=96=B0=202.=E4=BF=AE=E6=94=B9=E5=8D=95?= =?UTF-8?q?=E9=80=89=E9=A2=98=E6=97=B6=E5=88=A0=E9=99=A4=E6=9F=90=E4=BA=9B?= =?UTF-8?q?=E9=80=89=E9=A1=B9=E6=9C=89=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 2 +- app/views/poll/_poll_question.html.erb | 12 ++++++++++++ app/views/poll/update_poll_question.js.erb | 8 ++++++-- 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 app/views/poll/_poll_question.html.erb diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 2f3c344cb..c82b9a385 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -122,7 +122,7 @@ class PollController < ApplicationController ################处理选项 if params[:question_answer] @poll_question.poll_answers.each do |answer| - @poll_question.poll_answers.destroy answer unless params[:question_answer].keys.include? answer.id.to_s + answer.destroy unless params[:question_answer].keys.include? answer.id.to_s end for i in 1..params[:question_answer].count question = @poll_question.poll_answers.find_by_id params[:question_answer].keys[i-1] diff --git a/app/views/poll/_poll_question.html.erb b/app/views/poll/_poll_question.html.erb new file mode 100644 index 000000000..7731c9821 --- /dev/null +++ b/app/views/poll/_poll_question.html.erb @@ -0,0 +1,12 @@ + +<% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %> + + + + + +<% end %> + \ No newline at end of file diff --git a/app/views/poll/update_poll_question.js.erb b/app/views/poll/update_poll_question.js.erb index 267a27ae2..39d0fcfd6 100644 --- a/app/views/poll/update_poll_question.js.erb +++ b/app/views/poll/update_poll_question.js.erb @@ -1,2 +1,6 @@ - -pollQuestionCancel(<%= @poll_question.id%>); \ No newline at end of file +$("#poll_questions_<%= @poll_question.id%>").html("
    " + + "<%= escape_javascript(render :partial => 'show_MC', :locals => {:poll_question => @poll_question}) %>" + + "
    " + + ""); From 34b8ffeb5bbde39d7a5d666904775ad4a4f7708a Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 16 Jan 2015 10:51:08 +0800 Subject: [PATCH 55/99] tongji --- app/controllers/poll_controller.rb | 16 ++++++++++++++-- app/controllers/projects_controller.rb | 4 ++-- app/views/poll/_choice_show.html.erb | 5 +++-- app/views/poll/statistics_result.html.erb | 8 +++++--- db/schema.rb | 2 +- 5 files changed, 25 insertions(+), 10 deletions(-) diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 084c43545..774923404 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -78,12 +78,24 @@ class PollController < ApplicationController end def statistics_result - @poll_questions = PollQuestion.all + @poll = Poll.find(params[:id]) + @offset, @limit = api_offset_and_limit({:limit => 10}) + @poll_questions = @poll.poll_questions + @poll_questions_count = @poll_questions.count + @poll_questions_pages = Paginator.new @poll_questions_count, @limit, params['page'] respond_to do |format| format.html{render :layout => 'base_courses'} end end + def get_poll_totalcount poll_question + @total_questions_count = poll_question.poll_votes.count + end + + def get_poll_everycount poll_answer + @every_answer_count = poll_answer.poll_votes.count + end + #添加单选题 def create_poll_question question_title = params[:poll_questions_title].nil? || params[:poll_questions_title].empty? ? l(:label_enter_single_title) : params[:poll_questions_title] @@ -111,7 +123,7 @@ class PollController < ApplicationController end end - private + private def find_poll_and_course @poll = Poll.find params[:id] @course = Course.find @poll.polls_group_id diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 5d43a4e20..5ff9a3f17 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -116,8 +116,8 @@ class ProjectsController < ApplicationController joins("LEFT JOIN #{ProjectStatus.table_name} ON #{Project.table_name}.id = #{ProjectStatus.table_name}.project_id").joins("LEFT JOIN #{ProjectScore.table_name} ON #{Project.table_name}.id = #{ProjectScore.table_name}.project_id"). where("#{Project.table_name}.project_type = ? ", Project::ProjectType_project) - @project_count = @projects_all.count - @project_pages = Paginator.new @project_count, per_page_option, params['page'] + @poll_questions_count = @projects_all.count + @poll_questions_pages = Paginator.new @project_count, per_page_option, params['page'] #gcm activity count diff --git a/app/views/poll/_choice_show.html.erb b/app/views/poll/_choice_show.html.erb index a37ca148a..aa425e748 100644 --- a/app/views/poll/_choice_show.html.erb +++ b/app/views/poll/_choice_show.html.erb @@ -1,3 +1,4 @@ +
    @@ -9,13 +10,13 @@ <% poll_question.poll_answers.each do |poll_answer| %> - + <% end %> - + diff --git a/app/views/poll/statistics_result.html.erb b/app/views/poll/statistics_result.html.erb index f0f992c90..1bdbb0ff1 100644 --- a/app/views/poll/statistics_result.html.erb +++ b/app/views/poll/statistics_result.html.erb @@ -17,19 +17,21 @@
    1. - 第1题:问题描述问题描述<%= poll_question.question_title %> [单选题]<% poll_question.poll_answers %> + 第<%= poll_question.question_number %>题:<%= poll_question.question_title %> [单选题]<% poll_question.poll_answers %>
      <%= render :partial =>'choice_show', :locals =>{ :poll_question => poll_question } %>
    + <% end %>
    -
    答题已完成 0%
    - +
    答题已完成 0%
    diff --git a/db/schema.rb b/db/schema.rb index 6c2a9f58a..f9ea40ae9 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20150112090810) do +ActiveRecord::Schema.define(:version => 20150114022710) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false From 0dc0ba3a4a36070971f9413c419b7713e3aa24c5 Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 16 Jan 2015 10:59:25 +0800 Subject: [PATCH 56/99] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=9D=83=E9=99=90=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/index.html.erb | 68 ++++++++++++++++++++--------------- app/views/poll/show.html.erb | 4 ++- 2 files changed, 43 insertions(+), 29 deletions(-) diff --git a/app/views/poll/index.html.erb b/app/views/poll/index.html.erb index e45bdfabb..0e5e956ca 100644 --- a/app/views/poll/index.html.erb +++ b/app/views/poll/index.html.erb @@ -11,34 +11,46 @@
    <% @polls.each do |poll|%> -
      -
    • - <% if has_commit_poll?(poll.id ,User.current) %> - <%= poll.polls_name %> - <% else %> - <%= link_to poll.polls_name, poll_path(poll.id), :class => "polls_title fl" %> - <% end %> -
    • -
    • - <%if @is_teacher%> - <%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fl ml10"%> - <% end%> -
    • -
    • - <% 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%> -
    • -
    • - <% if @is_teacher%> - <%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml20"%> - <% end%> -
    • -
    • - <%= format_time poll.created_at%> -
    • -
    + + <% unless !@is_teacher && poll.polls_status != 2 %> +
      +
    • + <% if @is_teacher %> + <% if has_commit_poll?(poll.id ,User.current) %> + <%= poll.polls_name %> + <% else %> + <%= link_to poll.polls_name, poll_path(poll.id), :class => "polls_title fl" %> + <% end %> + <% else %> + <% if has_commit_poll?(poll.id ,User.current) && poll.polls_status == 2 %> + <%= poll.polls_name %> + <% elsif (!has_commit_poll?(poll.id ,User.current)) && poll.polls_status == 2 %> + <%= link_to poll.polls_name, poll_path(poll.id), :class => "polls_title fl" %> + <% end %> + <% end %> +
    • +
    • + <%if @is_teacher%> + <%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fl ml10"%> + <% end%> +
    • +
    • + <% if @is_teacher && poll.polls_status == 1 #新建状态的问卷可删除%> + <%= link_to(l(:button_delete), poll, + method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml20 mr10") %> + <% end%> +
    • +
    • + <% if @is_teacher && poll.polls_status == 1 #新建状态的问卷可编辑%> + <%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml20"%> + <% end%> +
    • +
    • + <%= format_time poll.created_at%> +
    • +
    + <% end %> +
    <% end%> diff --git a/app/views/poll/show.html.erb b/app/views/poll/show.html.erb index dca45c25c..2db0045f6 100644 --- a/app/views/poll/show.html.erb +++ b/app/views/poll/show.html.erb @@ -217,7 +217,9 @@
    - <%= link_to "提交",commit_poll_poll_path(@poll), :method => :post,:class => "ur_button",:format => 'js',:remote=>true %> + <% if @poll.polls_status == 2 %> + <%= link_to "提交",commit_poll_poll_path(@poll), :method => :post,:class => "ur_button",:format => 'js',:remote=>true %> + <% end %>
    答题已完成 0%
    From a683acf85c465cc75c7b7a41d54c2c8f2826fab1 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 16 Jan 2015 11:05:04 +0800 Subject: [PATCH 57/99] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E9=97=AE=E5=8D=B7=E6=97=B6=E5=88=B7=E6=96=B0=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=EF=BC=8C=E4=BC=9A=E6=96=B0=E5=BB=BA=E4=B8=80=E4=B8=AA=E9=97=AE?= =?UTF-8?q?=E5=8D=B7=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index a843e9d9b..9c5f810c6 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -46,9 +46,7 @@ class PollController < ApplicationController } @poll = Poll.create option if @poll - respond_to do |format| - format.html{render :layout => 'base_courses'} - end + redirect_to edit_poll_url @poll.id end elsif @project #项目的问卷调查相关代码 From a5cf1576f1626d7eeebe79c812270e129418d4de Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 16 Jan 2015 13:44:20 +0800 Subject: [PATCH 58/99] =?UTF-8?q?=E5=B0=86=E6=96=B0=E5=A2=9E=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E6=A0=8F=E6=94=BE=E5=88=B0=E9=97=AE=E9=A2=98=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E4=B8=8B=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/_poll_form.html.erb | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/app/views/poll/_poll_form.html.erb b/app/views/poll/_poll_form.html.erb index 598ef1207..1c2afc27c 100644 --- a/app/views/poll/_poll_form.html.erb +++ b/app/views/poll/_poll_form.html.erb @@ -60,6 +60,19 @@
    + +
    + <%= render :partial => 'show_head', :locals => {:poll => @poll}%> +
    + + + +
    + <%= render :partial => 'poll_content', :locals => {:poll => @poll}%> +
    +
    • @@ -86,19 +99,6 @@
    - -
    - <%= render :partial => 'show_head', :locals => {:poll => @poll}%> -
    - - - -
    - <%= render :partial => 'poll_content', :locals => {:poll => @poll}%> -
    -
    From 2954bba4117c7d852a1e7a5f88b7db51f01fb07e Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 16 Jan 2015 13:54:06 +0800 Subject: [PATCH 59/99] =?UTF-8?q?j=E8=BF=9B=E5=85=A5=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E3=80=81=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E9=97=AE=E5=8D=B7=E5=A4=B4=E6=98=BE=E7=A4=BA=E4=B8=BA=E5=8F=AF?= =?UTF-8?q?=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/_poll_form.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/poll/_poll_form.html.erb b/app/views/poll/_poll_form.html.erb index 1c2afc27c..1b30c973d 100644 --- a/app/views/poll/_poll_form.html.erb +++ b/app/views/poll/_poll_form.html.erb @@ -61,10 +61,10 @@
    -
    + - +<% end%> \ No newline at end of file diff --git a/app/views/poll/_new_MC.html.erb b/app/views/poll/_new_MC.html.erb index 013bf0ed0..f4f1ef676 100644 --- a/app/views/poll/_new_MC.html.erb +++ b/app/views/poll/_new_MC.html.erb @@ -1,6 +1,5 @@ <%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%> -
    - +
    @@ -35,11 +34,10 @@
    -
    <% end%> \ No newline at end of file diff --git a/app/views/poll/_new_MCQ.html.erb b/app/views/poll/_new_MCQ.html.erb index 6739c233e..23f216427 100644 --- a/app/views/poll/_new_MCQ.html.erb +++ b/app/views/poll/_new_MCQ.html.erb @@ -1,33 +1,41 @@ -
    +<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>
    - + + - - + +
      -
    • - - - - +
    • + + + +
    • -
      -
    • - - - - +
      +
    • + + + +
    • -
      +
      +
    • + + + + +
    • +
    -
    \ No newline at end of file +<% end%> \ No newline at end of file diff --git a/app/views/poll/_show_MC.html.erb b/app/views/poll/_show_MC.html.erb index f3fc9c8b5..594baea9d 100644 --- a/app/views/poll/_show_MC.html.erb +++ b/app/views/poll/_show_MC.html.erb @@ -7,7 +7,7 @@ <%if poll_question.is_necessary == 1%> * <%end%> - + (单选题)
    <%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id), method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %> diff --git a/app/views/poll/_show_MCQ.html.erb b/app/views/poll/_show_MCQ.html.erb index e56de53b9..64e39523a 100644 --- a/app/views/poll/_show_MCQ.html.erb +++ b/app/views/poll/_show_MCQ.html.erb @@ -1,28 +1,31 @@
    - 第2题: 多选题 * + + 第<%= poll_question.question_number%>题: + + <%= poll_question.question_title %> + <%if poll_question.is_necessary == 1%> + * + <%end%> + (多选题)
    - - + <%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id), + method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %> +
    <%= poll_answer.answer_text %> 24 <% poll_answer.poll_votes.count %>
    75%
    本题有效填写人次 26<%= poll_question.poll_votes.count %>  
    - - - - - - - - - + <% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %> + + + + <% end %>
    - -
    - -
    - -
    + +
    diff --git a/app/views/poll/create_poll_question.js.erb b/app/views/poll/create_poll_question.js.erb index 18f999157..ac44ebb4c 100644 --- a/app/views/poll/create_poll_question.js.erb +++ b/app/views/poll/create_poll_question.js.erb @@ -1,10 +1,26 @@ $("#new_poll_question").html(""); $("#poll_content").append("
    " + "
    " + + "<% if @poll_questions.question_type == 1%>" + "<%= escape_javascript(render :partial => 'show_MC', :locals => {:poll_question => @poll_questions}) %>" + + "<% elsif @poll_questions.question_type == 2%>" + + "<%= escape_javascript(render :partial => 'show_MCQ', :locals => {:poll_question => @poll_questions}) %>" + + "<% elsif @poll_questions.question_type == 3%>" + + "<%= escape_javascript(render :partial => 'show_single', :locals => {:poll_question => @poll_questions}) %>" + + "<% elsif @poll_questions.question_type == 4%>" + + "<%= escape_javascript(render :partial => 'show_mulit', :locals => {:poll_question => @poll_questions}) %>" + + "<% end%>" + "
    " + "" + "
    "); From f46c8e8adc8cdd6c626667f538249520a168d9e4 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 16 Jan 2015 14:47:09 +0800 Subject: [PATCH 62/99] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E5=8D=95=E9=80=89?= =?UTF-8?q?=E3=80=81=E5=A4=9A=E9=80=89=E5=8F=96=E6=B6=88=E4=B9=8B=E5=90=8E?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E7=BB=A7=E7=BB=AD=E6=96=B0=E5=BB=BA=E7=9A=84?= =?UTF-8?q?BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/_new_MC.html.erb | 2 +- app/views/poll/_new_MCQ.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/poll/_new_MC.html.erb b/app/views/poll/_new_MC.html.erb index f4f1ef676..5ff70e9eb 100644 --- a/app/views/poll/_new_MC.html.erb +++ b/app/views/poll/_new_MC.html.erb @@ -35,7 +35,7 @@
    diff --git a/app/views/poll/_new_MCQ.html.erb b/app/views/poll/_new_MCQ.html.erb index 23f216427..d94964bbf 100644 --- a/app/views/poll/_new_MCQ.html.erb +++ b/app/views/poll/_new_MCQ.html.erb @@ -34,7 +34,7 @@
From 65a3ddce41b921f5f3b0ec13867db4f451aad6d1 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 16 Jan 2015 15:05:30 +0800 Subject: [PATCH 63/99] =?UTF-8?q?1=E3=80=81=E5=A2=9E=E5=8A=A0=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=8D=95=E8=A1=8C=E6=96=87=E5=AD=97=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=202=E3=80=81=E4=BF=AE=E6=94=B9=E9=A2=98=E7=9B=AE=E5=90=8E?= =?UTF-8?q?=E6=80=BB=E6=98=AF=E6=98=BE=E7=A4=BA=E4=B8=BA=E5=8D=95=E9=80=89?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 3 +-- app/views/poll/_edit_single.html.erb | 14 +++++++---- app/views/poll/_new_single.html.erb | 29 ++++++++++++---------- app/views/poll/_show_single.html.erb | 14 ++++++++--- app/views/poll/update_poll_question.js.erb | 20 +++++++++++++-- 5 files changed, 55 insertions(+), 25 deletions(-) diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 9c5f810c6..fc23166ff 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -119,8 +119,7 @@ class PollController < ApplicationController #修改单选题 def update_poll_question @poll_question = PollQuestion.find params[:poll_question] - @poll = @poll_question.poll - + #@poll = @poll_question.poll @poll_question.is_necessary = params[:is_necessary]=="true" ? 1 : 0 @poll_question.question_title = params[:poll_questions_title].nil? || params[:poll_questions_title].empty? ? l(:label_enter_single_title) : params[:poll_questions_title] ################处理选项 diff --git a/app/views/poll/_edit_single.html.erb b/app/views/poll/_edit_single.html.erb index 4e98babe4..b8157ee6c 100644 --- a/app/views/poll/_edit_single.html.erb +++ b/app/views/poll/_edit_single.html.erb @@ -1,13 +1,17 @@ +<%= form_for("",:url => update_poll_question_poll_index_path(:poll_question => poll_question.id),:remote => true) do |f|%>
- - + + + />
-
\ No newline at end of file +
+<% end%> \ No newline at end of file diff --git a/app/views/poll/_new_single.html.erb b/app/views/poll/_new_single.html.erb index b7d5a9725..ec06933a8 100644 --- a/app/views/poll/_new_single.html.erb +++ b/app/views/poll/_new_single.html.erb @@ -1,13 +1,16 @@ -
-
- - - - -
- -
-
\ No newline at end of file +<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%> +
+
+ + + + + +
+ +
+
+<% end%> \ No newline at end of file diff --git a/app/views/poll/_show_single.html.erb b/app/views/poll/_show_single.html.erb index 437e38044..d9ef2abc7 100644 --- a/app/views/poll/_show_single.html.erb +++ b/app/views/poll/_show_single.html.erb @@ -1,9 +1,17 @@
- 第3题: 单行文字 + + 第<%= poll_question.question_number%>题: + + <%= poll_question.question_title %> + <%if poll_question.is_necessary == 1%> + * + <%end%> + (单行文字)
- - + <%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id), + method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %> +
diff --git a/app/views/poll/update_poll_question.js.erb b/app/views/poll/update_poll_question.js.erb index 39d0fcfd6..e0727df67 100644 --- a/app/views/poll/update_poll_question.js.erb +++ b/app/views/poll/update_poll_question.js.erb @@ -1,6 +1,22 @@ $("#poll_questions_<%= @poll_question.id%>").html("
" + - "<%= escape_javascript(render :partial => 'show_MC', :locals => {:poll_question => @poll_question}) %>" + + "<% if @poll_question.question_type == 1%>" + + "<%= escape_javascript(render :partial => 'show_MC', :locals => {:poll_question => @poll_question}) %>" + + "<% elsif @poll_question.question_type == 2%>" + + "<%= escape_javascript(render :partial => 'show_MCQ', :locals => {:poll_question => @poll_question}) %>" + + "<% elsif @poll_question.question_type == 3%>" + + "<%= escape_javascript(render :partial => 'show_single', :locals => {:poll_question => @poll_question}) %>" + + "<% elsif @poll_question.question_type == 4%>" + + "<%= escape_javascript(render :partial => 'show_mulit', :locals => {:poll_question => @poll_question}) %>" + + "<% end%>" + "
" + ""); From 0a367249ae3b7f3fb32072316c5324f55ed570e8 Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 16 Jan 2015 15:32:09 +0800 Subject: [PATCH 64/99] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E5=BA=A6=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 90 +++++++++++++++++++++------ app/views/poll/_commit_alert.html.erb | 2 +- app/views/poll/show.html.erb | 27 ++++++-- 3 files changed, 95 insertions(+), 24 deletions(-) diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index a843e9d9b..8f89c1a9e 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -24,6 +24,7 @@ class PollController < ApplicationController render_403 else @can_edit_poll = (!has_commit_poll?(@poll.id,User.current.id)) || User.current.admin? + @percent = get_percent(@poll,User.current) poll_questions = @poll.poll_questions @poll_questions = paginateHelper poll_questions,3 #分页 respond_to do |format| @@ -172,7 +173,7 @@ class PollController < ApplicationController def commit_answer pq = PollQuestion.find(params[:poll_question_id]) if has_commit_poll?(@poll.id,User.current.id) && (!User.current.admin?) - render :text => 'failure' + render :json => {:text => "failure"} return end if pq.question_type == 1 @@ -185,9 +186,10 @@ class PollController < ApplicationController end pv.poll_answer_id = params[:poll_answer_id] if pv.save - render :text => "ok" + @percent = get_percent(@poll,User.current) + render :json => {:text => "ok" ,:percent => format("%.2f" ,@percent)} else - render :text => "failure" + render :json => {:text => "failure"} end elsif pq.question_type == 2 pv = PollVote.find_by_poll_answer_id_and_user_id(params[:poll_answer_id],User.current.id) @@ -197,38 +199,64 @@ class PollController < ApplicationController pv.poll_question_id = params[:poll_question_id] pv.poll_answer_id = params[:poll_answer_id] if pv.save - render :text => "true" + @percent = get_percent(@poll,User.current) + render :json => {:text => "true",:percent => format("%.2f" ,@percent)} else - render :text => "failure" + render :json => {:text => "failure"} end else if pv.delete - render :text => "false" + @percent = get_percent(@poll,User.current) + render :json => {:text => "false" ,:percent => format("%.2f" ,@percent)} else - render :text => "failure" + render :json => {:text => "failure"} end end elsif pq.question_type == 3 || pq.question_type == 4 pv = PollVote.find_by_poll_question_id_and_user_id(params[:poll_question_id],User.current.id) if pv.nil? - pv = PollVote.new - pv.user_id = User.current.id - pv.poll_question_id = params[:poll_question_id] - end - pv.vote_text = params[:vote_text] - if pv.save - render :text => pv.vote_text + if params[:vote_text].nil? || params[:vote_text].blank? + @percent = get_percent(@poll,User.current) + render :json => {:text => pv.vote_text,:percent => format("%.2f" ,@percent)} + else + pv = PollVote.new + pv.user_id = User.current.id + pv.poll_question_id = params[:poll_question_id] + pv.vote_text = params[:vote_text] + if pv.save + @percent = get_percent(@poll,User.current) + render :json => {:text => pv.vote_text,:percent => format("%.2f" ,@percent)} + else + render :json => {:text => "failure"} + end + end else - render :text => "failure" + if params[:vote_text].nil? || params[:vote_text].blank? + if pv.delete + @percent = get_percent(@poll,User.current) + render :json => {:text => pv.vote_text,:percent => format("%.2f" ,@percent)} + else + render :json => {:text => "failure"} + end + else + pv.vote_text = params[:vote_text] + if pv.save + @percent = get_percent(@poll,User.current) + render :json => {:text => pv.vote_text,:percent => format("%.2f" ,@percent)} + else + render :json => {:text => "failure"} + end + end end + else - render :text => "failure" + render :json => {:text => "failure"} end end #提交问卷 def commit_poll - @uncomplete_question = get_uncomplete_question(@poll) + @uncomplete_question = get_uncomplete_question(@poll,User.current) if @uncomplete_question.count < 1 pu = get_poll_user(@poll.id,User.current.id) pu.user_id = User.current.id @@ -277,17 +305,41 @@ class PollController < ApplicationController end #获取未完成的题目 - def get_uncomplete_question poll + def get_uncomplete_question poll,user necessary_questions = poll.poll_questions.where("#{PollQuestion.table_name}.is_necessary = 1") uncomplete_question = [] necessary_questions.each do |question| - if question.poll_votes.nil? || question.poll_votes.count < 1 + answers = get_user_answer(question,user) + if answers.nil? || answers.count < 1 uncomplete_question << question end end uncomplete_question end + #获取用户对某个问题的答案 + def get_user_answer(question,user) + user_answer = question.poll_votes.where("#{PollVote.table_name}.user_id = #{user.id}") + user_answer + end + + def get_complete_question(poll,user) + questions = poll.poll_questions + complete_question = [] + questions.each do |question| + answers = get_user_answer(question,user) + if !(answers.nil? || answers.count < 1) + complete_question << question + end + end + complete_question + end + + def get_percent poll,user + complete_count = get_complete_question(poll,user).count + (complete_count.to_f / poll.poll_questions.count.to_f)*100 + end + #PollUser记录用户是否已提交问卷有对应的记录则已提交,没有则新建一个 def get_poll_user poll_id,user_id pu = PollUser.find_by_poll_id_and_user_id(poll_id,user_id) diff --git a/app/views/poll/_commit_alert.html.erb b/app/views/poll/_commit_alert.html.erb index 76bbda416..3910bc8b5 100644 --- a/app/views/poll/_commit_alert.html.erb +++ b/app/views/poll/_commit_alert.html.erb @@ -3,7 +3,7 @@

提交成功!

<%= link_to "确定", poll_index_path(:polls_group_id => @course.id,:polls_type => 'Course'),:class => 'commit'%> <% elsif status == 1 %> -

您还有尚未作答的题目请完成后在提交!

+

您还有尚未作答的必答题目请完成后再提交!

<%= link_to "确定", "javascript:void(0)",:onclick => 'hidden_atert_form();',:class => 'commit'%> <% else %>

发生未知错误,请检查您的网络。

diff --git a/app/views/poll/show.html.erb b/app/views/poll/show.html.erb index 2db0045f6..42818dd34 100644 --- a/app/views/poll/show.html.erb +++ b/app/views/poll/show.html.erb @@ -72,7 +72,10 @@ poll_question_id: <%= pq.id %> }, success: function (data) { - obj.checked = true; + var dataObj = eval(data); + obj.checked = true; + var span = $('#percent'); + span.html(dataObj.percent); } }); } @@ -118,7 +121,8 @@ poll_question_id: <%= pq.id %> }, success: function (data) { - if(data == "true") + var dataObj = eval(data); + if(dataObj.text == "true") { obj.checked = true; } @@ -126,6 +130,8 @@ { obj.checked = false; } + var span = $('#percent'); + span.html(dataObj.percent); } }); } @@ -165,6 +171,9 @@ vote_text: obj.value }, success: function (data) { + var dataObj = eval(data); + var span = $('#percent'); + span.html(dataObj.percent); // obj.value = data; } }); @@ -198,7 +207,17 @@ vote_text: obj.innerHTML }, success: function (data) { -// obj.value = data; + var dataObj = eval(data); + if(dataObj.text != 'failure') + { + var span = $('#percent'); + span.html(dataObj.percent); + } + else + { + alert("error"); + } + } }); } @@ -222,7 +241,7 @@ <% end %>
-
答题已完成 0%
+
答题已完成 <%= format "%.2f" ,@percent %>%
From fe3a84c8db35c648478d900bd2c1faa9433f5af9 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 16 Jan 2015 15:34:25 +0800 Subject: [PATCH 65/99] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=A4=9A=E8=A1=8C=E6=96=87=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/_edit_mulit.html.erb | 19 +++++++++++-------- app/views/poll/_new_mulit.html.erb | 21 ++++++++++++--------- app/views/poll/_show_mulit.html.erb | 14 +++++++++++--- 3 files changed, 34 insertions(+), 20 deletions(-) diff --git a/app/views/poll/_edit_mulit.html.erb b/app/views/poll/_edit_mulit.html.erb index c4a9e0e0f..684a285e3 100644 --- a/app/views/poll/_edit_mulit.html.erb +++ b/app/views/poll/_edit_mulit.html.erb @@ -1,18 +1,21 @@ +<%= form_for("",:url => update_poll_question_poll_index_path(:poll_question => poll_question.id),:remote => true) do |f|%>
- - + + + />
- - , - + + +
-
\ No newline at end of file +
+<% end%> \ No newline at end of file diff --git a/app/views/poll/_new_mulit.html.erb b/app/views/poll/_new_mulit.html.erb index 6c3528473..e034e54af 100644 --- a/app/views/poll/_new_mulit.html.erb +++ b/app/views/poll/_new_mulit.html.erb @@ -1,18 +1,21 @@ +<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>
- - - + + + +
- - , - + + +
-
\ No newline at end of file +
+<% end%> \ No newline at end of file diff --git a/app/views/poll/_show_mulit.html.erb b/app/views/poll/_show_mulit.html.erb index 35e37ef06..23bdbe6eb 100644 --- a/app/views/poll/_show_mulit.html.erb +++ b/app/views/poll/_show_mulit.html.erb @@ -1,10 +1,18 @@
- 第4题: 多行主观 + + 第<%= poll_question.question_number%>题: + + <%= poll_question.question_title %> + <%if poll_question.is_necessary == 1%> + * + <%end%> + (多行主观)
- - + <%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id), + method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %> +
From 7177303eeb4899010db5af9c831b85504813970b Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 16 Jan 2015 15:49:22 +0800 Subject: [PATCH 66/99] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=9C=80=E7=BB=88=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 2 +- app/helpers/poll_helper.rb | 18 ++++++++- app/views/poll/_choice_show.html.erb | 49 ++++++++++++----------- app/views/poll/statistics_result.html.erb | 10 ++--- config/locales/zh.yml | 5 +++ 5 files changed, 53 insertions(+), 31 deletions(-) diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 3de4e8339..3b4bf3694 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -86,7 +86,7 @@ class PollController < ApplicationController def statistics_result @poll = Poll.find(params[:id]) poll_questions = @poll.poll_questions - @poll_questions = paginateHelper poll_questions,3 #分页 + @poll_questions = paginateHelper poll_questions, 5 respond_to do |format| format.html{render :layout => 'base_courses'} end diff --git a/app/helpers/poll_helper.rb b/app/helpers/poll_helper.rb index 7816d8e37..1a8fabae3 100644 --- a/app/helpers/poll_helper.rb +++ b/app/helpers/poll_helper.rb @@ -27,7 +27,7 @@ module PollHelper false end end - + #获取文本题答案 def get_anwser_vote_text(question_id,user_id) pv = PollVote.find_by_poll_question_id_and_user_id(question_id,user_id) @@ -47,4 +47,20 @@ module PollHelper true end end + + #统计答题百分比 + def statistics_result_percentage(e, t) + return e*100/t + end + + def options_show p + case p + when 1 + "单选题" + when 2 + "多选题" + else + "问答题" + end + end end \ No newline at end of file diff --git a/app/views/poll/_choice_show.html.erb b/app/views/poll/_choice_show.html.erb index aa425e748..16971d5ad 100644 --- a/app/views/poll/_choice_show.html.erb +++ b/app/views/poll/_choice_show.html.erb @@ -1,25 +1,28 @@ -
- - - - - - - - <% poll_question.poll_answers.each do |poll_answer| %> - - - - - - <% end %> - - - - - - -
选项 小计 比例
<%= poll_answer.answer_text %> <% poll_answer.poll_votes.count %>
75%
本题有效填写人次 <%= poll_question.poll_votes.count %> 
-
+ + + + + + + + <% poll_question.poll_answers.each do |poll_answer| %> + + + + + + <% end %> + + + + + + +
<%= l(:label_poll_options) %> <%= l(:label_poll_subtotal) %> <%= l(:label_poll_proportion) %>
<%= poll_answer.answer_text %> <%= poll_answer.poll_votes.count %> +
+ +
+ <%= statistics_result_percentage(poll_answer.poll_votes.count, @poll.users.count) %>%
<%= l(:label_poll_valid_commit) %> <%= poll_question.poll_votes.count %> 
+
diff --git a/app/views/poll/statistics_result.html.erb b/app/views/poll/statistics_result.html.erb index d6181fb1a..dea18f8d8 100644 --- a/app/views/poll/statistics_result.html.erb +++ b/app/views/poll/statistics_result.html.erb @@ -2,14 +2,14 @@ - 问卷调查_问卷结果 + <%= l(:label_poll_result) %> <%= stylesheet_link_tag 'polls', :media => 'all' %>
-

某问卷统计

+

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

<% @poll_questions.each do |poll_question| %> @@ -17,7 +17,8 @@
  1. - 第<%= poll_question.question_number %>题:<%= poll_question.question_title %> [单选题]<% poll_question.poll_answers %> + 第<%= poll_question.question_number %>题:<%= poll_question.question_title %> + [<%= options_show(poll_question.question_type) %>]
    <%= render :partial =>'choice_show', :locals =>{ :poll_question => poll_question } %>
  2. @@ -28,11 +29,8 @@
    - -
    -
    答题已完成 0%
diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 95ab07d5d..5c2925b90 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2253,5 +2253,10 @@ zh: label_new_answer: 新建选项 label_poll_title: 问卷标题 label_poll_description: 问卷描述 + label_poll_options: 选项 + label_poll_subtotal: 小计 + label_poll_proportion: 比例 + label_poll_valid_commit: 本题有效填写人次 + label_poll_result: 问卷调查_问卷统计 From dd42c89ee6972d08237fe549dffe51503c4f279a Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 16 Jan 2015 15:51:26 +0800 Subject: [PATCH 67/99] =?UTF-8?q?=E7=99=BE=E5=88=86=E6=AF=94=E9=99=A4?= =?UTF-8?q?=E6=95=B0=E4=B8=BA0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index d77f7c872..221c482c7 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -178,20 +178,26 @@ class PollController < ApplicationController #单选题 pv = PollVote.find_by_poll_question_id_and_user_id(params[:poll_question_id],User.current.id) if pv.nil? + #尚未答该题,添加答案 pv = PollVote.new pv.user_id = User.current.id pv.poll_question_id = params[:poll_question_id] end + #修改该题对应答案 pv.poll_answer_id = params[:poll_answer_id] if pv.save + #保存成功返回成功信息及当前以答题百分比 @percent = get_percent(@poll,User.current) render :json => {:text => "ok" ,:percent => format("%.2f" ,@percent)} else + #返回失败信息 render :json => {:text => "failure"} end elsif pq.question_type == 2 + #多选题 pv = PollVote.find_by_poll_answer_id_and_user_id(params[:poll_answer_id],User.current.id) if pv.nil? + #尚未答该题,添加答案 pv = PollVote.new pv.user_id = User.current.id pv.poll_question_id = params[:poll_question_id] @@ -203,6 +209,7 @@ class PollController < ApplicationController render :json => {:text => "failure"} end else + #pv不为空,则当前选项之前已被选择,再次点击则是不再选择该项,故删除该答案 if pv.delete @percent = get_percent(@poll,User.current) render :json => {:text => "false" ,:percent => format("%.2f" ,@percent)} @@ -211,12 +218,16 @@ class PollController < ApplicationController end end elsif pq.question_type == 3 || pq.question_type == 4 + #单行文本,多行文本题 pv = PollVote.find_by_poll_question_id_and_user_id(params[:poll_question_id],User.current.id) if pv.nil? + #pv为空之前尚未答题,添加答案 if params[:vote_text].nil? || params[:vote_text].blank? + #用户提交空答案,视作不作答 @percent = get_percent(@poll,User.current) render :json => {:text => pv.vote_text,:percent => format("%.2f" ,@percent)} else + #添加答案 pv = PollVote.new pv.user_id = User.current.id pv.poll_question_id = params[:poll_question_id] @@ -229,7 +240,9 @@ class PollController < ApplicationController end end else + #pv不为空说明用户之前已作答 if params[:vote_text].nil? || params[:vote_text].blank? + #用户提交空答案,视为删除答案 if pv.delete @percent = get_percent(@poll,User.current) render :json => {:text => pv.vote_text,:percent => format("%.2f" ,@percent)} @@ -237,6 +250,7 @@ class PollController < ApplicationController render :json => {:text => "failure"} end else + #用户修改答案 pv.vote_text = params[:vote_text] if pv.save @percent = get_percent(@poll,User.current) @@ -335,7 +349,11 @@ class PollController < ApplicationController def get_percent poll,user complete_count = get_complete_question(poll,user).count - (complete_count.to_f / poll.poll_questions.count.to_f)*100 + if poll.poll_questions.count == 0 + return 0 + else + return (complete_count.to_f / poll.poll_questions.count.to_f)*100 + end end #PollUser记录用户是否已提交问卷有对应的记录则已提交,没有则新建一个 From 79ad33a90f40ed65569d337c9c5f3fc876da12a6 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 16 Jan 2015 15:57:49 +0800 Subject: [PATCH 68/99] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E9=97=AE=E5=8D=B7=E7=9A=84=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 11 ++++++++--- config/routes.rb | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 28c44f0cb..2e7d95478 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -90,7 +90,7 @@ class PollController < ApplicationController end end - #添加单选题 + #添加题目 def create_poll_question question_title = params[:poll_questions_title].nil? || params[:poll_questions_title].empty? ? l(:label_enter_single_title) : params[:poll_questions_title] option = { @@ -117,7 +117,7 @@ class PollController < ApplicationController end end - #修改单选题 + #修改题目 def update_poll_question @poll_question = PollQuestion.find params[:poll_question] #@poll = @poll_question.poll @@ -150,7 +150,7 @@ class PollController < ApplicationController end end - #删除单选题 + #删除题目 def delete_poll_question @poll_question = PollQuestion.find params[:poll_question] @poll = @poll_question.poll @@ -166,6 +166,11 @@ class PollController < ApplicationController end end + #发布问卷 + def publish_poll + + end + #提交答案 def commit_answer pq = PollQuestion.find(params[:poll_question_id]) diff --git a/config/routes.rb b/config/routes.rb index dc8205e2d..bd1b27dee 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -64,6 +64,7 @@ RedmineApp::Application.routes.draw do post 'commit_answer' post 'create_poll_question' post 'commit_poll' + get 'publish_poll' end collection do delete 'delete_poll_question' From bbf4c4629b69a93d70847fd76d5e0edffa6d28e3 Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 16 Jan 2015 16:13:03 +0800 Subject: [PATCH 69/99] =?UTF-8?q?=E9=97=AE=E5=8D=B7show=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/show.html.erb | 22 +++++++++++----------- config/locales/en.yml | 6 ++++-- config/locales/zh.yml | 4 ++++ 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/app/views/poll/show.html.erb b/app/views/poll/show.html.erb index 42818dd34..c1ac5d377 100644 --- a/app/views/poll/show.html.erb +++ b/app/views/poll/show.html.erb @@ -2,7 +2,7 @@ - 问卷调查_问卷页面 + <%= l(:label_poll_title) %> <%= stylesheet_link_tag 'polls', :media => 'all' %> + + + + + +
+
+

问卷发布

+

+ 问卷发布后将无法 + 修改 +
+ 是否确定发布该问卷? +

+
+ <%= link_to "确 定",publish_poll_poll_path(poll.id), :class => "tijiao", :onclick => "clickCanel();" %> + + 取  消 + +
+
+
+ + + From d16d5fd362179d62fde4efebf24bd8f9cb91f8b3 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 16 Jan 2015 17:31:04 +0800 Subject: [PATCH 72/99] =?UTF-8?q?=E5=8D=95=E8=A1=8C=E6=96=87=E5=AD=97/?= =?UTF-8?q?=E5=A4=9A=E8=A1=8C=E6=96=87=E5=AD=97=20-->=20=E5=8D=95=E8=A1=8C?= =?UTF-8?q?=E4=B8=BB=E8=A7=82/=E5=A4=9A=E8=A1=8C=E4=B8=BB=E8=A7=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/_edit_mulit.html.erb | 2 +- app/views/poll/_edit_single.html.erb | 2 +- app/views/poll/_new_mulit.html.erb | 2 +- app/views/poll/_new_single.html.erb | 2 +- app/views/poll/_show_single.html.erb | 2 +- config/locales/zh.yml | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/poll/_edit_mulit.html.erb b/app/views/poll/_edit_mulit.html.erb index 684a285e3..f4e079c17 100644 --- a/app/views/poll/_edit_mulit.html.erb +++ b/app/views/poll/_edit_mulit.html.erb @@ -3,7 +3,7 @@
- + />
diff --git a/app/views/poll/_edit_single.html.erb b/app/views/poll/_edit_single.html.erb index b8157ee6c..b172d955c 100644 --- a/app/views/poll/_edit_single.html.erb +++ b/app/views/poll/_edit_single.html.erb @@ -4,7 +4,7 @@ + name="poll_questions_title" placeholder="请输入单行主观标题" value="<%= poll_question.question_title%>"/> />
diff --git a/app/views/poll/_new_mulit.html.erb b/app/views/poll/_new_mulit.html.erb index e034e54af..155f208c4 100644 --- a/app/views/poll/_new_mulit.html.erb +++ b/app/views/poll/_new_mulit.html.erb @@ -3,7 +3,7 @@
- +
diff --git a/app/views/poll/_new_single.html.erb b/app/views/poll/_new_single.html.erb index ec06933a8..fb052a7a3 100644 --- a/app/views/poll/_new_single.html.erb +++ b/app/views/poll/_new_single.html.erb @@ -3,7 +3,7 @@
- +
diff --git a/app/views/poll/_show_single.html.erb b/app/views/poll/_show_single.html.erb index d9ef2abc7..bfea07d86 100644 --- a/app/views/poll/_show_single.html.erb +++ b/app/views/poll/_show_single.html.erb @@ -7,7 +7,7 @@ <%if poll_question.is_necessary == 1%> * <%end%> - (单行文字) + (单行主观)
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id), method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %> diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 5c2925b90..e607214b5 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2247,8 +2247,8 @@ zh: label_statistical_results: 统计结果 label_MC: 单选题 label_MCQ: 多选题 - label_single: 单行文字 - label_mulit: 多行文字 + label_single: 单行主观 + label_mulit: 多行主观 label_enter_single_title: 请输入单选题标题 label_new_answer: 新建选项 label_poll_title: 问卷标题 From 3acec4b7c10c082c25b1f4e79cadc8b5e1adc013 Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 17 Jan 2015 10:14:07 +0800 Subject: [PATCH 73/99] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E6=80=BB?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/poll_helper.rb | 8 +++++--- app/views/poll/_choice_show.html.erb | 2 +- app/views/poll/statistics_result.html.erb | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/helpers/poll_helper.rb b/app/helpers/poll_helper.rb index 55418faf2..36b5deccb 100644 --- a/app/helpers/poll_helper.rb +++ b/app/helpers/poll_helper.rb @@ -48,15 +48,16 @@ module PollHelper end end - #统计答题百分比 + #统计答题百分比,统计结果保留两位小数 def statistics_result_percentage(e, t) e = e.to_f t = t.to_f t == 0 ? 0 : format("%.2f", e*100/t) end - def options_show p - case p + #页面体型显示 + def options_show pq + case pq when 1 "单选题" when 2 @@ -65,4 +66,5 @@ module PollHelper "问答题" end end + end \ No newline at end of file diff --git a/app/views/poll/_choice_show.html.erb b/app/views/poll/_choice_show.html.erb index 16971d5ad..4ccc5b938 100644 --- a/app/views/poll/_choice_show.html.erb +++ b/app/views/poll/_choice_show.html.erb @@ -19,7 +19,7 @@ <% end %> <%= l(:label_poll_valid_commit) %> - <%= poll_question.poll_votes.count %> + <%= @poll.users.count %>   diff --git a/app/views/poll/statistics_result.html.erb b/app/views/poll/statistics_result.html.erb index 057314a9c..3ef29eb48 100644 --- a/app/views/poll/statistics_result.html.erb +++ b/app/views/poll/statistics_result.html.erb @@ -27,7 +27,7 @@
-
+

From 9487ce1245894efa0a9a45314c4ec6de7f93ebd1 Mon Sep 17 00:00:00 2001 From: z9hang Date: Sat, 17 Jan 2015 11:02:09 +0800 Subject: [PATCH 74/99] =?UTF-8?q?#1807=E8=AF=BE=E7=A8=8B--=E9=97=AE?= =?UTF-8?q?=E5=8D=B7=E8=B0=83=E6=9F=A5=EF=BC=9A=E7=AD=94=E9=A2=98=E5=A4=9A?= =?UTF-8?q?=E8=A1=8C=E4=B8=BB=E8=A7=82=E5=90=8E=EF=BC=8C=E5=86=8D=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E6=89=93=E5=BC=80=E7=AD=94=E9=A2=98=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=EF=BC=8C=E5=A6=82=E5=9B=BE=EF=BC=8C=E6=98=BE=E7=A4=BAhtml?= =?UTF-8?q?=E5=85=83=E7=B4=A0
?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/show.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/poll/show.html.erb b/app/views/poll/show.html.erb index c1ac5d377..bc5136718 100644 --- a/app/views/poll/show.html.erb +++ b/app/views/poll/show.html.erb @@ -180,7 +180,7 @@ } - > + >
<% elsif pq.question_type == 4 %> @@ -222,7 +222,7 @@ }); } -
" onblur="onblur_<%= pq.id %>(this);"><%= get_anwser_vote_text(pq.id,User.current.id) %>
+
" onblur="onblur_<%= pq.id %>(this);"><%= get_anwser_vote_text(pq.id,User.current.id).html_safe %>
From e14deeb4ddde7393a007615920ad9bd2e53a148d Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 17 Jan 2015 11:05:38 +0800 Subject: [PATCH 75/99] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=99=90=E5=88=B6?= =?UTF-8?q?=EF=BC=9A=E9=97=AE=E5=8D=B7=E6=A0=87=E9=A2=98=E6=9C=80=E5=A4=9A?= =?UTF-8?q?100=E5=AD=97=EF=BC=8C=E9=97=AE=E5=8D=B7=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E6=9C=80=E5=A4=9A300=E5=AD=97=EF=BC=8C=E9=97=AE=E5=8D=B7?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E6=9C=80=E5=A4=9A250=E5=AD=97=EF=BC=8C?= =?UTF-8?q?=E9=97=AE=E5=8D=B7=E9=80=89=E9=A1=B9=E6=9C=80=E5=A4=9A200?= =?UTF-8?q?=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/_edit_MC.html.erb | 4 ++-- app/views/poll/_edit_MCQ.html.erb | 4 ++-- app/views/poll/_edit_head.html.erb | 4 ++-- app/views/poll/_edit_mulit.html.erb | 2 +- app/views/poll/_edit_single.html.erb | 2 +- app/views/poll/_new_MC.html.erb | 8 ++++---- app/views/poll/_new_MCQ.html.erb | 8 ++++---- app/views/poll/_new_mulit.html.erb | 2 +- app/views/poll/_new_single.html.erb | 2 +- app/views/poll/_poll_form.html.erb | 2 +- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/app/views/poll/_edit_MC.html.erb b/app/views/poll/_edit_MC.html.erb index 12dc9f92b..505e9acc1 100644 --- a/app/views/poll/_edit_MC.html.erb +++ b/app/views/poll/_edit_MC.html.erb @@ -4,7 +4,7 @@
- + />
@@ -13,7 +13,7 @@ <% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %>
  • - +
  • diff --git a/app/views/poll/_edit_MCQ.html.erb b/app/views/poll/_edit_MCQ.html.erb index f34319569..5e267b03e 100644 --- a/app/views/poll/_edit_MCQ.html.erb +++ b/app/views/poll/_edit_MCQ.html.erb @@ -2,7 +2,7 @@
    - + />
    @@ -11,7 +11,7 @@ <% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %>
  • - +
  • diff --git a/app/views/poll/_edit_head.html.erb b/app/views/poll/_edit_head.html.erb index ea36cbedf..802832601 100644 --- a/app/views/poll/_edit_head.html.erb +++ b/app/views/poll/_edit_head.html.erb @@ -1,10 +1,10 @@ <%= form_for @poll,:remote => true do |f|%>
    - +
    - +