New Discussion

Notifications

You’re not receiving notifications from this thread.

Need a suggestion on the approach I should take to implement the multi-version surveys system.

0
General

I have an existing survey feature in my application. As standard, a survey has many questions, and many answers are submitted against a question by different users. There is a result model per survey for a user to see his report for submitted answers.

Now I need to extend this feature into a multi-version part. A new survey version will be created whenever a change is made. It could be text change or adding/deleting a question in it. With this, I need to make sure the users previously assigned a survey still see their own version. So if the question was added to a survey. They should not see it. The new version of surveys will be available for new assignments only.

I need a suggestion on what approach I should take to extend this feature with these requirements. I have already looked at (and used in the past) the PaperTrail gem and also looked at https://github.com/westonganger/active_snapshot.

Think of a scenario where I had Question A in Version 1 of the survey but that question got deleted from it now. A user was previously assigned Version 1 of the survey and he is answering Question A. How should I manage the Database structure to manage the associations in such cases?

Join the discussion
Create an account Log in

Learning Ruby on Rails? Join our newsletter.

We won't send you spam. Unsubscribe at any time.