Created
June 15, 2014 09:25
-
-
Save hlxwell/f1e0084d1cb5517d86a5 to your computer and use it in GitHub Desktop.
Get Primebook book questions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Book.all.each do |book| | |
next if !book.pages.any? {|p| p.questions.count > 0} | |
puts "============ #{book.name} ===============" | |
book.pages.each do |page| | |
next if page.questions.count == 0 | |
puts " Page##{page.page_number}" | |
page.questions.each do |question| | |
puts " * Question: #{question.content}" | |
question.question_options.each do |option| | |
puts " - #{option.content} #{"√" if option.is_correct_answer}" | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment