introduce check_other and radio_other question types

completes issue #48
This commit is contained in:
Mark Moser
2016-08-31 16:59:25 -05:00
parent 229ebf1380
commit df1b101aa2
12 changed files with 276 additions and 14 deletions

View File

@ -51,6 +51,7 @@ class QuizController < ApplicationController
:radio,
:text,
checkbox: [],
with_other: [:other, options: []],
live_code: [:later, :html, :css, :js, :text]
)
end
@ -110,4 +111,11 @@ class QuizController < ApplicationController
saved: params.key?(:save),
submitted: params.key?(:submit))
end
def process_radio_other
@answer.update(answer: answer_params[:with_other].to_h,
saved: params.key?(:save),
submitted: params.key?(:submit))
end
alias process_checkbox_other process_radio_other
end