diff --git a/app/controllers/exercise_controller.rb b/app/controllers/exercise_controller.rb index f83e31a56..f363b9297 100644 --- a/app/controllers/exercise_controller.rb +++ b/app/controllers/exercise_controller.rb @@ -178,7 +178,7 @@ class ExerciseController < ApplicationController # params[:question_answer] eg:A、B、C选项 def update_exercise_question @exercise_question = ExerciseQuestion.find params[:exercise_question] - @exercise_questions.question_title = params[:exercise_questions_title].nil? || params[:exercise_questions_title].empty? ? l(:label_enter_single_title) : params[:exercise_questions_title] + @exercise_question.question_title = params[:exercise_questions_title].nil? || params[:exercise_questions_title].empty? ? l(:label_enter_single_title) : params[:exercise_questions_title] ################处理选项 if params[:question_answer] @exercise_question.exercise_answers.each do |answer| @@ -194,7 +194,7 @@ class ExerciseController < ApplicationController question.save else question_option = { - :exercise_choices_id => i, + :exercise_choice_id => i, :answer_text => answer } @exercise_question.exercise_answers.new question_option diff --git a/app/views/exercise/_edit_MC.html.erb b/app/views/exercise/_edit_MC.html.erb index e69de29bb..5a406537b 100644 --- a/app/views/exercise/_edit_MC.html.erb +++ b/app/views/exercise/_edit_MC.html.erb @@ -0,0 +1,63 @@ +<%= form_for("",:url => update_exercise_question_exercise_index_path(:exercise_question => exercise_question.id),:remote => true) do |f|%> + + + +