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