Lss file import - how to keep IDs while importing?

More
1 month 2 weeks ago #182655 by arunicbe
I am developing surveys in my wamp server and import the surveys in the live server through .lss files.

While importing, the IDs of the question/ group changed automatically. I have couple of scripts to generate reports based on the question/responses. The scripts refer the questions by ID.

How do I keep the IDs same so it does not affect the scripts?

Please Log in or Create an account to join the conversation.

LimeSurvey Partners
More
1 month 2 weeks ago - 1 month 2 weeks ago #182672 by Joffm
Hi,

How do I keep the IDs same so it does not affect the scripts?

Please, do not try.

As you might know the GID (in lime_groups) and QID (in lime_questions) are implemented as "auto increment".
If they were not A.I. and stayed the same as in an imported *.lss, you'd get a lot of key violations (two groups, same GID, etc.)

Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 month 2 weeks ago by Joffm.

Please Log in or Create an account to join the conversation.

More
1 month 2 weeks ago #182674 by tpartner
I'm assuming these scripts are not in the question source, otherwise you could use {QID}.

A workaround would be to assign CSS classes to the questions and have your scripts target those class names.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!