The models you have are: Campaign, User, Card, Question and Response. Here's how I would do it using ActiveRecord
Campaigns exist with questions and responses by users. The Campaign model would look like this:
class Campaign < ActiveRecord::Base
has_many :questions
has_many :responses, :through => :questions
endThis means that the questions table has a campaign_id on it, and responses would have question_id. The Question model looks like this:
class Question < ActiveRecord::Base
belongs_to :campaign
has_many :responses
endclass PredefinedAnswer < ActiveRecord::Base
belongs_to :question
endResponses belong to a user, and also a question. The Response model:
class Response < ActiveRecord::Base
belongs_to :record
belongs_to :question
belongs_to :predefined_answer
endclass Record < ActiveRecord::Base
belongs_to :user
belongs_to :campaign
endThe User model looks like this:
class User < ActiveRecord::Base
has_many :responses
endI don't know what cards have to do with any of this, since these are represented in the physical world only, it seems. Perhaps this could be represented in the database too, but I don't see a need for it.