Forcing question IDs?

More
4 months 3 weeks ago #171411 by caitifty
caitifty created the topic: Forcing question IDs?
Hi,

I'm planning to set up multiple (>20) small community organizations with their own individual copy of limesurvey (on the same server) to ask an identical questionnaire. Each organization will only be able to look at their own data, but we also want to be able to combine certain data points from each survey. To do this, I'm planning to just write some code to grab the relevant variables from the relevant survey in each individual mysql database. So far, so good.

My question is, is there a way to force the underlying question ID for each question to be the same in every survey? When I copy an lss file from one installation to the next, it assigns new numbers, so 'What's the service date?' might be X10X211 in one database and X34X323 on the next. I can certainly write some sort of master index containing the survey number and the 'local' variable names for every installation, but this would get pretty tedious as the number of installations and number of variables of interest get larger. I was wondering if there's any way to force the question ids (and ideally survey ids) so that 'What's the service date?' is (for example) X10X211 on *every* survey, with only the mysql database name changing from installation to installation?

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

More
4 months 3 weeks ago #171414 by tpartner
tpartner replied the topic: Forcing question IDs?
The question and group IDs are assigned sequentially so ,as far as I know, you cannot force them.

I'm no SQL expert but how about using the question codes instead of IDs in your queries?

(...or use the API?)

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: caitifty

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

More
4 months 3 weeks ago #171428 by DenisChenu
DenisChenu replied the topic: Forcing question IDs?
Quick answer : you can't … really you can't …

Question key are qid + language
Question have sid and gid

Then you can't.

And yes : API is here, or take a look at VV import/export

Else : you can use gitlab.com/SondagesPro/coreAndTools/getQ...surveyCodeHelper.php : return an array for DBcolumn (123X12X1234) to EM question code (Q01)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
The following user(s) said Thank You: caitifty

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

More
4 months 3 weeks ago #171455 by caitifty
caitifty replied the topic: Forcing question IDs?
Thanks Denis, I think the code you provided will solve my problem by letting me automate identifying the DBcolumn connected to each question code for each installation.

Kind regards

Peter

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

More
4 months 2 weeks ago #171476 by LouisGac
LouisGac replied the topic: Forcing question IDs?
I'd say you can by using a docker container you copy for each organisation.
The following user(s) said Thank You: caitifty

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!