From 096320d04cb7ab3a81f2968b4b11550cd2e0a4db Mon Sep 17 00:00:00 2001 From: cxt Date: Sat, 20 Feb 2016 10:50:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E5=B8=83=E9=97=AE=E5=8D=B7=E6=97=B6?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E9=80=89=E4=B8=AD=E2=80=9C=E5=85=81=E8=AE=B8?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E6=9F=A5=E7=9C=8B=E8=B0=83=E6=9F=A5=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 1 + app/views/poll/_poll_form.html.erb | 8 ++++++-- db/schema.rb | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 78babc43c..1d7b4117d 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -214,6 +214,7 @@ class PollController < ApplicationController def publish_poll @poll.polls_status = 2 @poll.published_at = Time.now + @poll.show_result = params[:show_result] if @poll.save if params[:is_remote] redirect_to poll_index_url(:polls_type => "Course", :polls_group_id => @course.id) diff --git a/app/views/poll/_poll_form.html.erb b/app/views/poll/_poll_form.html.erb index e6b667075..e08b13033 100644 --- a/app/views/poll/_poll_form.html.erb +++ b/app/views/poll/_poll_form.html.erb @@ -315,7 +315,11 @@ function insert_MCQ(quest_type,quest_num,quest_id){ alert("问卷标题不能为空"); } else{ - $('#ajax-modal').html('<%= escape_javascript(render :partial => 'poll_submit', locals: { :poll => @poll,:is_remote => false}) %>'); + if($("#show_result").is(":checked")) { + $('#ajax-modal').html('<%= escape_javascript(render :partial => 'poll_submit', locals: { :poll => @poll,:is_remote => false,:show_result=> 1}) %>'); + } else{ + $('#ajax-modal').html('<%= escape_javascript(render :partial => 'poll_submit', locals: { :poll => @poll,:is_remote => false,:show_result=> 0}) %>'); + } showModal('ajax-modal', '310px'); $('#ajax-modal').css('height','120px'); $('#ajax-modal').siblings().remove(); @@ -377,7 +381,7 @@ function insert_MCQ(quest_type,quest_num,quest_id){ <%= l(:label_memo_create)%>
- +
diff --git a/db/schema.rb b/db/schema.rb index be876fa7b..003d99c0f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1219,7 +1219,6 @@ ActiveRecord::Schema.define(:version => 20160202034530) do create_table "org_members", :force => true do |t| t.integer "user_id" t.integer "organization_id" - t.string "role" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false end @@ -1374,6 +1373,7 @@ ActiveRecord::Schema.define(:version => 20160202034530) do t.integer "changeset_num", :default => 0 t.integer "board_message_num", :default => 0 t.integer "board_num", :default => 0 + t.integer "act_num", :default => 0 t.integer "attach_num", :default => 0 t.datetime "commit_time" end