AutoCommit Sam Aug 1 16:03:03 CEST 2015

This commit is contained in:
Andreas Stephanides
2015-08-01 16:03:03 +02:00
parent ab0559a45c
commit dae218c4ff
5 changed files with 19 additions and 8 deletions

View File

@@ -9,8 +9,17 @@ class Survey::QuestionsController < ApplicationController
end
end
def answer
@survey_question = Survey::Question.find(params[:id])
@survey_question.do_answer(params[:survey_question][:selected],current_user)
@survey_question = Survey::Question.find(params[:id])
if (params[:key].nil? || params[:key].empty?)
user = current_user
else
k=Key.find_by_uuid(params[:key] )
if k.is_valid && k.typ==3 && k.parent == @survey_question
user = k.user
end
end
@survey_question.do_answer(params[:survey_question][:selected],user)
render :show
end
# GET /survey/questions/1