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|%> + + + +
+
+ + + +
+
+ +
+ +
+
+ +<% end%> \ No newline at end of file diff --git a/app/views/exercise/_new_single.html.erb b/app/views/exercise/_new_single.html.erb index e4e1db695..4d9baf729 100644 --- a/app/views/exercise/_new_single.html.erb +++ b/app/views/exercise/_new_single.html.erb @@ -19,17 +19,17 @@
  • - +
  • - +
  • - +
  • diff --git a/config/routes.rb b/config/routes.rb index 8dba79d2c..422f470d5 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -157,6 +157,7 @@ RedmineApp::Application.routes.draw do collection do #生成路径为 /exercise/方法名 delete 'delete_exercise_question' + post 'update_exercise_question' end end