2016-07-27 22:16:12 -05:00
|
|
|
class CandidateController < ApplicationController
|
|
|
|
def welcome
|
|
|
|
end
|
|
|
|
|
|
|
|
def question
|
2016-07-27 22:53:14 -05:00
|
|
|
@question = Question.order("RAND()").first # .where(input_type: 'live-coder')
|
2016-07-27 22:16:12 -05:00
|
|
|
@status = QuizStatus.new(Candidate.order("RAND()").first)
|
|
|
|
@answer = @question.answers.order("RAND()").first
|
|
|
|
end
|
|
|
|
|
2016-07-28 08:47:34 -05:00
|
|
|
def update_question
|
|
|
|
|
|
|
|
redirect_to saved_path if params[:submit] == 'Save'
|
|
|
|
redirect_to :question
|
|
|
|
end
|
|
|
|
|
2016-07-27 22:16:12 -05:00
|
|
|
def summary
|
|
|
|
end
|
|
|
|
|
|
|
|
def thankyou
|
|
|
|
end
|
|
|
|
|
|
|
|
def saved
|
|
|
|
end
|
2016-07-28 08:47:34 -05:00
|
|
|
|
|
|
|
def validate
|
|
|
|
redirect_to :question
|
|
|
|
end
|
2016-07-27 22:16:12 -05:00
|
|
|
end
|