Is it possible to somehow use the database to create one survey that basically copies another? For example, I would like to have one version of the survey for each month, and may have a few minor changes each month, but not enough to go through recreating all the fields in the normal process. So is there some way to copy and existing survey into a new one while leaving the old one as is?

Comments

bermin’s picture

Yup, me too. Got a nice big survey form that needs to be replicated 50 times. Must be a way to do it using the database, no? Anyone?

walkah’s picture

Assigned: Unassigned » walkah

interesting feature... i'll look into this. patches accepted of course :)

jasonwhat’s picture

Any follow up on this? I have one survey I use for a volunteer submission form. It is quite a long survey and it is growing quickly. Ideally I'd like to replicate this survey every month so there would be an excel download available on a monthly basis. I don't mind doing this from within the database, just not sure what fields need to be replicated. Thanks.

enky’s picture

this will be a cool feature,

liquidcms’s picture

Title: Repeating a survey » Cloning a survey

yup, this would be useful.. but i changed the title as "cloning" is a more accurate term for this.. "repeating" sounds like taking the survey multiple times.. which prevention of this is another feature that i think this module should have..

tomdrupal’s picture

this would be useful indeed has any one got any news about this?

Ashraf Amayreh’s picture

Status: Active » Closed (fixed)

There are a number of modules that provide this functionality. Node Clone comes to mind, but I think a number of other modules provide this functionality as well.

beekerstudios’s picture

FYI I know this isn't a fix, but this may lead to developing an add-on for the module... possibly?

FIrst things first create a new survey node (and note the nid for the node).

I did this by doing an sql dump of the form_field table (only the fid's for the survey you want to clone, find replace the fid with a new fid number that isn't already present in the form_field table):
Using PHPMyAdmin

SELECT  `fid` ,  `title` ,  `explanation` ,  `page` ,  `type` ,  `weight` ,  `required` ,  `flags` ,  `validation` ,  `options` ,  `multiple` 
FROM  `form_fields` 
WHERE fid =  '4'

And then checking select all and then clicking on export at the bottom will give you an sql dump interface and I just pull this data sql insert code out:

INSERT INTO `form_fields` (`fid`, `title`, `explanation`, `page`, `type`, `weight`, `required`, `flags`, `validation`, `options`, `multiple`) VALUES 
(4, 'field #2', '', '', 'textfield', 0, 1, 'a:2:{s:3:"nid";s:3:"302";s:6:"submit";s:10:"Save field";}', '', '', 0),
(4, 'field #2', '', '', 'textarea', 0, 0, 'a:2:{s:3:"nid";s:3:"302";s:6:"submit";s:10:"Save field";}', '', '', 0);

You will need to change it to something like this (changing the 4 and 302 from above):

INSERT INTO `form_fields` (`fid`, `title`, `explanation`, `page`, `type`, `weight`, `required`, `flags`, `validation`, `options`, `multiple`) VALUES 
(5, 'field #2', '', '', 'textfield', 0, 1, 'a:2:{s:3:"nid";s:3:"303";s:6:"submit";s:10:"Save field";}', '', '', 0),
(5, 'field #2', '', '', 'textarea', 0, 0, 'a:2:{s:3:"nid";s:3:"303";s:6:"submit";s:10:"Save field";}', '', '', 0);

The 303 is the NID for the cloned survey node.

Dump the INSERT command back into PHPMyAdmin, and then modify the value in form_fields for the sequences table for form_fields_ffid entry to the highest value ffid value plus 1. So if the highest ffid value in form_fields is 59 you would enter 60. I encountered errors not doing this after the insert command dump when trying to add more fields to the survey. Doing this fixed the error.

Again not a fix, but for a large form it saves you a little bit. I could see replicating the insert command as many times as you wanted to clone it for duplicating as many survey's as you wanted to.

bchoc’s picture

Category: support » feature
Status: Closed (fixed) » Active

This was closed because other modules exist to provide this functionality, however, the Node Clone module does not successfully copy surveys. I'm suggesting a reopen as a feature request.

beekerstudios’s picture

I agree... seems worthwhile to have a specific survey clone tool built into survey.

quicksketch’s picture

Status: Active » Closed (fixed)

Survey module is no longer being maintained, use Webform module instead.

---Closing down issue queue of survey module---