skill-assessment-app/app/controllers/candidate_controller.rb

35 lines
591 B
Ruby
Raw Normal View History

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
2016-07-28 09:37:46 -05:00
redirect_to :saved and return if params[:save] == 'Save'
2016-07-28 08:47:34 -05:00
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-28 09:37:46 -05:00
private
def question_params
params.permit(:save)
end
2016-07-27 22:16:12 -05:00
end