|
|
|
@ -91,15 +91,17 @@ class PollVotesController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
else #主观题的输入
|
|
|
|
|
# current_vote_text = user_votes.find_vote_text
|
|
|
|
|
if user_votes.present?
|
|
|
|
|
user_votes.first.update_attribute("vote_text", question_answer_text)
|
|
|
|
|
# if question_answer_text.present?
|
|
|
|
|
# user_votes.first.update_attribute("vote_text", question_answer_text)
|
|
|
|
|
# else
|
|
|
|
|
# user_votes.destroy_all
|
|
|
|
|
# end
|
|
|
|
|
else
|
|
|
|
|
PollVote.create(vote_answer_params)
|
|
|
|
|
if question_answer_text.present?
|
|
|
|
|
if user_votes.present?
|
|
|
|
|
user_votes.first.update_attribute("vote_text", question_answer_text)
|
|
|
|
|
# if question_answer_text.present?
|
|
|
|
|
# user_votes.first.update_attribute("vote_text", question_answer_text)
|
|
|
|
|
# else
|
|
|
|
|
# user_votes.destroy_all
|
|
|
|
|
# end
|
|
|
|
|
else
|
|
|
|
|
PollVote.create(vote_answer_params)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
@current_question_number = @poll_question.question_number
|
|
|
|
|