问卷报网络异常

This commit is contained in:
cxt 2016-12-17 15:36:45 +08:00
parent ef78de1a9c
commit 158ea7dc41
1 changed files with 2 additions and 1 deletions

View File

@ -299,7 +299,8 @@ class PollController < ApplicationController
def commit_answer
pq = PollQuestion.find(params[:poll_question_id])
if has_commit_poll?(@poll.id,User.current.id) && (!User.current.admin?)
render :json => {:text => "failure"}
@percent = get_percent(@poll,User.current)
render :json => {:text => "ok" ,:percent => format("%.2f" ,@percent)}
return
end
if pq.question_type == 1