Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Copy Survey Not Working - Question Codes

More
9 years 3 months ago - 9 years 3 months ago #115473 by cshaw
Replied by cshaw on topic Copy Survey Not Working - Question Codes
Thanks Mazi, point well taken. I am only working on a proof-of-concept survey at the moment so I am not too worried about it. I would never attempt such a thing on a production survey. IMO a production survey shouldn't ever NEED to be changed like that. I would make a copy of the existing survey, modify the copy and make it the new production survey preserving the old one. I seldom even move responses from an old version to a new version, I feel that obscures the history for the responses ... and in a research setting that can make a big difference ... the exception is when the modification is VERY minor such as a tweak to the look or correction of a typo.

I did use Notepad++ for searching and replacing in the raw XML (.lsg)

For example I have a whole group of questions that need to be asked for each of the respondent's female relatives to get a health history. I prefaced each question in the group with fr1, exported the group, opened the .lsg file in Notepad++ (Love that program) did a search and replace of fr1 with fr2, so for instance fr1cancerdx became fr2cancerdx, changed the name of the group from FemaleRelative1 to FemaleRelative2 and saved. Then back in the survey I imported the revised group. Worked like a charm and all the questions now have their unique fr2 preface and anywhere they were referenced in a relevance equation or elsewhere is also updated.

This wouldn't work for places I referenced the variables outside of the group, but since my goal was just to save myself the tedium of copying each question one at a time, this was a great time saver!

PLUS: I figured the worst thing that could happen is that the group wouldn't import as I had hoped, but it actually went really smoothly.
Last edit: 9 years 3 months ago by cshaw. Reason: grammar
The topic has been locked.
More
9 years 3 months ago #115479 by cshaw
Replied by cshaw on topic Copy Survey Not Working - Question Codes
BTW: In Notepad++ I recorded a macro to do the modifications to the first relative to make them the second relative group. THEN I opened the Notepad++ file "shortcuts.xls" and copied the macro to make a third, fourth, fifth and sixth relative macro with a little tweaking. Now converting a group for the first relative is as easy as opening the lsg file in Notepad++, running the appropriate macro, saving the revisions, and then importing the revised lsg into the survey. Slick and Quick!
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 3 months ago #115486 by DenisChenu
Replied by DenisChenu on topic Copy Survey Not Working - Question Codes

Mazi wrote: Guys, please do such changes with care, it could really break your survey so always created backups!

Hi,

We don't update the DB directly, but it's done by LimeSurvey. If we make error : LS don't accept the lsg file.

I don't see any real reason to do a backup before. It's like we try to add a group + question manually.

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
9 years 3 months ago #115504 by Mazi
Replied by Mazi on topic Copy Survey Not Working - Question Codes
Denis, I know that you know what you are doing when dealing with such a workaround.

For all others it can never hurt recommending creating backups :-)

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 3 months ago #115508 by DenisChenu
Replied by DenisChenu on topic Copy Survey Not Working - Question Codes

Mazi wrote: Denis, I know that you know what you are doing when dealing with such a workaround.

But it's not a workaround !

You don't tell to user to da a backup each time they add a question !

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose