From 07ee81937056274fd0a1b38c68408673bce1511d Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 20 Nov 2015 13:39:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E5=A4=9A=E9=80=89=E7=AD=94?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/exercise_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/exercise_controller.rb b/app/controllers/exercise_controller.rb index 3d6b4794f..9efcfc19d 100644 --- a/app/controllers/exercise_controller.rb +++ b/app/controllers/exercise_controller.rb @@ -345,7 +345,7 @@ class ExerciseController < ApplicationController end elsif eq.question_type == 2 #多选题 - ea = ExerciseAnswer.find_by_exercise_question_id_and_user_id(params[:exercise_question_id],User.current.id) + ea = ExerciseAnswer.find_by_exercise_choice_id_and_user_id(params[:exercise_choice_id],User.current.id) if ea.nil? #尚未答该题,添加答案 ea = ExerciseAnswer.new @@ -360,7 +360,7 @@ class ExerciseController < ApplicationController end else #pv不为空,则当前选项之前已被选择,再次点击则是不再选择该项,故删除该答案 - if pv.delete + if ea.delete @percent = get_percent(@exercise, User.current) render :json => {:text => "false" ,:percent => format("%.2f" , @percent)} else