diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 196b3c7ba..a63f9e8f6 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -89,7 +89,7 @@ class PollController < ApplicationController 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 = { - :is_necessary => params[:is_necessary] || true, + :is_necessary => params[:is_necessary] || 1, :question_title => question_title, :question_type => params[:question_type] || 1, :question_number => @poll.poll_questions.count + 1 @@ -112,6 +112,11 @@ class PollController < ApplicationController end end + #修改单选题 + def update_poll_question + a = 1 + end + private def find_poll_and_course @poll = Poll.find params[:id] diff --git a/app/views/poll/_edit_MC.html.erb b/app/views/poll/_edit_MC.html.erb index 0f031f61c..cc52e7c6b 100644 --- a/app/views/poll/_edit_MC.html.erb +++ b/app/views/poll/_edit_MC.html.erb @@ -1,37 +1,25 @@ -<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%> +<%= form_for poll_question,:url =>update_poll_question_poll_path(@poll.id),:remote => true do |f|%>
- - - + + +
    -
  • - - - - -
  • -
    -
  • - - - - -
  • -
    -
  • - - - - -
  • -
    + <% poll_question.poll_answers.reorder("answer_position") do |poll_answer| %> +
  • + + + + +
  • +
    + <% end%>