Merge branch 'cxt_course' of https://git.trustie.net/jacknudt/trustieforge into cxt_course

This commit is contained in:
Tim 2015-12-30 16:05:08 +08:00
commit d71e8376ae
1 changed files with 2 additions and 2 deletions

View File

@ -450,7 +450,7 @@ class ExerciseController < ApplicationController
if params[:answer_text].nil? || params[:answer_text].blank?
#用户提交空答案,视作不作答
@percent = get_percent(@exercise,User.current)
render :json => {:text => ea.answer_text,:percent => format("%.2f", @percent)}
render :json => {:text => "",:percent => format("%.2f", @percent)}
else
#添加答案
ea = ExerciseAnswer.new
@ -476,7 +476,7 @@ class ExerciseController < ApplicationController
# 用户提交空答案,视为删除答案
if ea.delete
@percent = get_percent(@exercise,User.current)
render :json => {:text => ea.answer_text,:percent => format("%.2f", @percent)}
render :json => {:text => "",:percent => format("%.2f", @percent)}
else
render :json => {:text => "failure"}
end