35 lines
591 B
Ruby
35 lines
591 B
Ruby
class CandidateController < ApplicationController
|
|
def welcome
|
|
end
|
|
|
|
def question
|
|
@question = Question.order("RAND()").first # .where(input_type: 'live-coder')
|
|
@status = QuizStatus.new(Candidate.order("RAND()").first)
|
|
@answer = @question.answers.order("RAND()").first
|
|
end
|
|
|
|
def update_question
|
|
redirect_to :saved and return if params[:save] == 'Save'
|
|
redirect_to :question
|
|
end
|
|
|
|
def summary
|
|
end
|
|
|
|
def thankyou
|
|
end
|
|
|
|
def saved
|
|
end
|
|
|
|
def validate
|
|
redirect_to :question
|
|
end
|
|
|
|
private
|
|
|
|
def question_params
|
|
params.permit(:save)
|
|
end
|
|
end
|