module One44::CLI::Helpers
Public Instance Methods
answer()
click to toggle source
# File lib/one44-cli/helpers.rb, line 6 def answer gets.chomp end
clean(answer)
click to toggle source
# File lib/one44-cli/helpers.rb, line 10 def clean(answer) Integer(answer).to_i rescue StandardError nil end
ordered_questions(test, question_order)
click to toggle source
# File lib/one44-cli/helpers.rb, line 16 def ordered_questions(test, question_order) question_order == :random ? randomise(questions_from(test)) : questions_from(test) end
questions_from(test)
click to toggle source
# File lib/one44-cli/helpers.rb, line 24 def questions_from(test) load_tests_from_csv_file(test, "\t\t") end
randomise(questions)
click to toggle source
# File lib/one44-cli/helpers.rb, line 20 def randomise(questions) questions.shuffle end