Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Copy Survey Not Working - Question Codes

Copy Survey Not Working - Question Codes 2 months 2 weeks ago #115439

  • ohvelma
  • ohvelma's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 53
  • Thank you received: 2
  • Karma: 2
Hi,

I update directly the lsg file for this, for example adding G1 at start of each question. Open with gedit and replace all G1 by G2.

It work, but it's not cool, then you can pit a feature request.

Hey I did what you suggest here and it works really slick. I still think the questions should be name-spaced, but this does the trick nicely. I hadn't attempted to modify the lsg file directly before, but that was a synch. LOVE being able to just search/replace. :)
The administrator has disabled public write access.

Copy Survey Not Working - Question Codes 2 months 2 weeks ago #115461

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5590
  • Thank you received: 319
  • Karma: 254
Guys, please do such changes with care, it could really break your survey so always created backups!

Best tools for using search/replace are Notepad++ (if you want to edit the raw file) and - since the export format is XML based - XML Notepad.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.
The following user(s) said Thank You: ohvelma

Copy Survey Not Working - Question Codes 2 months 2 weeks ago #115473

  • ohvelma
  • ohvelma's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 53
  • Thank you received: 2
  • Karma: 2
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: 2 months 2 weeks ago by ohvelma. Reason: grammar
The administrator has disabled public write access.

Copy Survey Not Working - Question Codes 2 months 2 weeks ago #115479

  • ohvelma
  • ohvelma's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 53
  • Thank you received: 2
  • Karma: 2
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 administrator has disabled public write access.

Copy Survey Not Working - Question Codes 2 months 2 weeks ago #115486

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6886
  • Thank you received: 925
  • Karma: 275
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
The administrator has disabled public write access.

Copy Survey Not Working - Question Codes 2 months 2 weeks ago #115504

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5590
  • Thank you received: 319
  • Karma: 254
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
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Copy Survey Not Working - Question Codes 2 months 2 weeks ago #115508

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6886
  • Thank you received: 925
  • Karma: 275
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 !
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.119 seconds
Donation Image