fixed question submission
This commit is contained in:
parent
90d0ef9db7
commit
8751a04669
@ -64,8 +64,7 @@ class CandidateController < ApplicationController
|
||||
def answer_params
|
||||
params.require(:answer).permit(
|
||||
:question_id, :answer_id,
|
||||
:save, :next, :summary,
|
||||
:radio, :text, checkbox: [], live_code: []
|
||||
:radio, :text, checkbox: [], live_code: [:later, :html, :css, :js]
|
||||
)
|
||||
end
|
||||
|
||||
@ -92,32 +91,32 @@ class CandidateController < ApplicationController
|
||||
def process_text
|
||||
@answer = prep_answer
|
||||
@answer.update(answer: answer_params[:text],
|
||||
saved: answer_params[:save],
|
||||
submitted: answer_params[:next])
|
||||
saved: params.key?(:save),
|
||||
submitted: params.key?(:submit))
|
||||
route_answer
|
||||
end
|
||||
|
||||
def process_radio
|
||||
@answer = prep_answer
|
||||
@answer.update(answer: answer_params[:radio],
|
||||
saved: answer_params[:save],
|
||||
submitted: answer_params[:next])
|
||||
saved: params.key?(:save),
|
||||
submitted: params.key?(:submit))
|
||||
route_answer
|
||||
end
|
||||
|
||||
def process_checkbox
|
||||
@answer = prep_answer
|
||||
@answer.update(answer: answer_params[:checkbox],
|
||||
saved: answer_params[:save],
|
||||
submitted: answer_params[:next])
|
||||
saved: params.key?(:save),
|
||||
submitted: params.key?(:submit))
|
||||
route_answer
|
||||
end
|
||||
|
||||
def process_live_code
|
||||
@answer = prep_answer
|
||||
@answer.update(answer: answer_params[:live_code],
|
||||
saved: answer_params[:save],
|
||||
submitted: answer_params[:next])
|
||||
@answer.update(answer: answer_params[:live_code].to_h,
|
||||
saved: params.key?(:save),
|
||||
submitted: params.key?(:submit))
|
||||
route_answer
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user