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

cxt_course
Tim 10 years ago
commit d71e8376ae

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

Loading…
Cancel
Save