Let's see, that would be:
# For Questions:
:has_many => :answers
:belongs_to => :test_question
# questions table should have the "test_question_id" column
# Answers:
:has_many => :candidate_answers
:belongs_to => :question
# Answers table should have the "question_id" column
#Test Questions:
:has_many => :questions
:has_many => :candidate_answers
:belongs_to => :test
# test questions table should have the "test_id" column but not the "question_id"
#Tests:
:has_many => :results
:has_many => :test_questions
:has_many => :candidates, :through => :results, :foreign_key => "candidate_id" #why not? ^^
#Results
:belongs_to => :test
:belongs_to => :candidate
# Results table should have the "test_id" and "candidate_id" columns
#candidate_answers
:belongs_to => :candidate
:belongs_to => :test_question
:belongs_to => :answer
# candidate_answers table should have the "test_question_id", "candidate_id" and "answer_id" columns
#Candidates
:has_many => :candidate_answers
:has_many => :results
:has_many => :answered_tests, :class_name => "test", :through => :results, :foreign_key => "test_id" # again, why not?
And with the information you gave, that should do what you want. ;)