surveyjs-wordpress icon indicating copy to clipboard operation
surveyjs-wordpress copied to clipboard

Copying survey

Open DenFin opened this issue 6 years ago • 10 comments

It would be very handy to be able to copy a survey from the mysurveys view. So one could create a survey as a template and then copy it when needed.

DenFin avatar May 23 '19 11:05 DenFin

Thank you for the feedback! I've added this task to our backlog.

tsv2013 avatar May 23 '19 11:05 tsv2013

Cool! Thank your for your quick reply. Can you tell when you will come around to this? More like sometime in the undefined future or more like in a month or so?

DenFin avatar May 23 '19 11:05 DenFin

More likely in a month or so. We'll collect a set of enchancements and then implement them.

tsv2013 avatar May 23 '19 11:05 tsv2013

Hi there! Is there any news about this?

DenFin avatar Aug 07 '19 12:08 DenFin

Hi @DenFin ! Unfortunately no, at this moment we have other task related to SurveyJS Library and SurveyJS Creator products.

tsv2013 avatar Aug 08 '19 06:08 tsv2013

Hi there! It's me again 😅. I have created a fork and implemented the feature that allows users to duplicate an existing survey. However this would be my first public pull request on GitHub, so I thought I might share my solution first before making a pull request to the official repository. It would be great if you could have a look at the code and provide some short feedback.

DenFin avatar Aug 27 '19 15:08 DenFin

@DenFin Yous code looks ok for me

tsv2013 avatar Aug 31 '19 09:08 tsv2013

@DenFin how is this achieved? I can't seem to find any reference of the same

mozesj avatar Jun 21 '23 10:06 mozesj

@mozesj Sorry, I deleted my fork some time ago. I have no expertise in PHP and back when I forked the repo I just copy pasted parts from the create_survey logic, edited it and from there on it was just trial and error. But looking at the code, it seems like this has been implemented. Maybe have a look at this file or this commit

DenFin avatar Jun 21 '23 13:06 DenFin

@DenFin how is this achieved? I can't seem to find any reference of the same

You can do this from the My Surveys Page in WordPress. Look for the green "clone" button.

https://github.com/surveyjs/surveyjs-wordpress/blob/26d6722d0edcb6574c1a8fb183303a19ffc51c07/src/trunk/views/mysurveys.php#L83

andyg2 avatar Jun 21 '23 15:06 andyg2