Skip to content

Commit

Permalink
Added seed data for quizzes and association links
Browse files Browse the repository at this point in the history
  • Loading branch information
sdflem committed Oct 22, 2018
1 parent a17d7a5 commit 49499eb
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,20 @@
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
# Character.create(name: 'Luke', movie: movies.first)

MultipleChoiceQuestion.create!(question: 'What method do we use to create a model record?', answer: 'create', distractor_1: 'update', distractor_2: 'delete', distractor_3: 'all', distractor_4: 'find')
quiz_1 = Quiz.new(title: 'Rails MVC', description: 'Rails MVC blah blah blah.')
quiz_1.questions.build(question: 'What method do we use to create a model record?', answer: 'create', distractor_1: 'update', distractor_2: 'delete', distractor_3: 'all', distractor_4: 'find')
quiz_1.questions.build(question: 'What does the C in MVC stand for?', answer: 'Controller', distractor_1: 'Const', distractor_2: 'Code', distractor_3: 'Create', distractor_4: 'Comm')
quiz_1.questions.build(question: 'What method do we use to delete a model record', answer: 'delete', distractor_1: 'update', distractor_2: 'create', distractor_3: 'all', distractor_4: 'find')
quiz_1.save!

MultipleChoiceQuestion.create!(question: 'What does the C in MVC stand for?', answer: 'Controller', distractor_1: 'Const', distractor_2: 'Code', distractor_3: 'Create', distractor_4: 'Comm')
quiz_2 = Quiz.new(title: 'Git', description: 'Git blah blah blah.')
quiz_2.questions.build(question: 'T or F? The pull command uploads changes to the remote repo.', answer: 'F', distractor_1: 'T')
quiz_2.questions.build(question: 'T or F? The push command uploads changes to the remote repo.', answer: 'T', distractor_1: 'F')
quiz_2.questions.build(question: 'T or F? The add command commits changes to the local repo.', answer: 'F', distractor_1: 'T')
quiz_2.save!

MultipleChoiceQuestion.create!(question: 'What method do we use to delete a model record', answer: 'delete', distractor_1: 'update', distractor_2: 'create', distractor_3: 'all', distractor_4: 'find')
quiz_3 = Quiz.new(title: 'UML Class Diagrams', description: 'UML blah blah blah.')
quiz_3.questions.build(question: 'T or F? The * multiplicity means 1 or more.', answer: 'F', distractor_1: 'T')
quiz_3.questions.build(question: 'T or F? Associations are denoted with boxes in class diagrams.', answer: 'F', distractor_1: 'T')
quiz_3.questions.build(question: 'T or F? The 1 multiplicity means exactly 1.', answer: 'T', distractor_1: 'F')
quiz_3.save!

0 comments on commit 49499eb

Please sign in to comment.