class Scale7Test
Final Scale7 Test
Class
Public Instance Methods
randomize!()
click to toggle source
Randomize the answers to a scale test
# File lib/jungi/classes.rb, line 225 def randomize! self.class.const_get(:QUESTIONS).length.times do |num| set_answer(num, rand(1..7)) end nil end
set_answer(index, value)
click to toggle source
Set question answer to value
# File lib/jungi/classes.rb, line 218 def set_answer(index, value) self.out_of_index? index fail "#{value} is not a scale!" unless Question::Answer.scale7?(value) @answers[index] = value end