- Posts: 5
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Import multiple question groups at once
- ZioPaolo
- Topic Author
- Offline
- New Member
Less
More
3 years 5 months ago #207360
by ZioPaolo
Import multiple question groups at once was created by ZioPaolo
Good morning,
I would like to know if there is a way to use the "import question group from file" feature and import more than one question group in a single operation.
Should I investigate more about importing more files (repeat import job over a list of files) or I can arrange a valid xml containing more than one group?
It is annoying right now that I have a relevance equation into group2 referring to a question in group1 and after making group-by-group export and import into antoher survey, this relevance equation get corrupted.
Thanks
Using LimeSurvey Version 3.24.3+201027
I would like to know if there is a way to use the "import question group from file" feature and import more than one question group in a single operation.
Should I investigate more about importing more files (repeat import job over a list of files) or I can arrange a valid xml containing more than one group?
It is annoying right now that I have a relevance equation into group2 referring to a question in group1 and after making group-by-group export and import into antoher survey, this relevance equation get corrupted.
Thanks
Using LimeSurvey Version 3.24.3+201027
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
3 years 5 months ago - 3 years 5 months ago #207372
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Import multiple question groups at once
No, not with the core code.I would like to know if there is a way to use the "import question group from file" feature and import more than one question group in a single operation.
This should not happen if using question codes in your relevance equations. Can you give an example?It is annoying right now that I have a relevance equation into group2 referring to a question in group1 and after making group-by-group export and import into antoher survey, this relevance equation get corrupted.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 3 years 5 months ago by tpartner.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- ZioPaolo
- Topic Author
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 0
3 years 5 months ago #207390
by ZioPaolo
Replied by ZioPaolo on topic Import multiple question groups at once
I prepared a minimal working example.
I attach here the SOURCE survey " " that is working as expected.
Following these steps:
I attach here the SOURCE survey " " that is working as expected.
Following these steps:
- Create a new DESTINATION survey by copying the SOURCE one
- Test DESTINATION survey: OK works as exepected (logic file has no errors)
- Delete all question groups from DESTINATION survey
- Export Group1 and Group2 from SOURCE survey (files and )
- Import (in this order) Group1 and Group2 into DESTINATION survey
- Test DESTINATION survey: KO (logic file has errors)
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12935
- Thank you received: 3979
3 years 5 months ago #207391
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Import multiple question groups at once
As you used the "outdated" condition builder instead of Expression Manager in your relevance equations, you are right.
You should change this.
Joffm
You should change this.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
3 years 5 months ago - 3 years 5 months ago #207394
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Import multiple question groups at once
Yep.
This should not happen if using question codes in your relevance equations.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 3 years 5 months ago by tpartner.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- ZioPaolo
- Topic Author
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 0
3 years 5 months ago #207403
by ZioPaolo
Replied by ZioPaolo on topic Import multiple question groups at once
Thanks for your time to analyse this.
Just a clarification because I'm a beginner with LimeSurvey: usage of Expression Manager is possible with my version of LimeSurvey (I'm on CE, Version 3.24.3+201027)?
To "use expression manager" means to define the relevance equation "by hand" while editing the single question, right?
Just a clarification because I'm a beginner with LimeSurvey: usage of Expression Manager is possible with my version of LimeSurvey (I'm on CE, Version 3.24.3+201027)?
To "use expression manager" means to define the relevance equation "by hand" while editing the single question, right?
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
3 years 5 months ago #207404
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Import multiple question groups at once
That's correct. After a little practice, you will find it far faster and more flexible than the conditions designer.The conditions designer is a legacy from versions before Expression Manager (ExpressionScript) was introduced.
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: DenisChenu
The topic has been locked.
- ZioPaolo
- Topic Author
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 0
3 years 5 months ago #207727
by ZioPaolo
Replied by ZioPaolo on topic Import multiple question groups at once
Following your suggestions I modified the survey by removing all conditions previously defined with the condition builder and I put the relevance equations that I need directly by editing questions themselves and groups.
Now I encountered another issue because if I import multiple times a group (the second one in my previous MWE) having his own conditions based on question codes, the whole behaviour is messy because question codes are not anymore unique.
How can I limit the "scope" of a question code only to the containing group?
There is any other way to solve this?
I really need to automatize survey creation without broking the logic.
Now I encountered another issue because if I import multiple times a group (the second one in my previous MWE) having his own conditions based on question codes, the whole behaviour is messy because question codes are not anymore unique.
How can I limit the "scope" of a question code only to the containing group?
There is any other way to solve this?
I really need to automatize survey creation without broking the logic.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12935
- Thank you received: 3979
3 years 5 months ago #207745
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Import multiple question groups at once
You should have provided the lss export of your survey and a lsg export of the group you want to import several times.
Please do not force us to create your scenario from scratch
Ease the life of us volunteers.
Joffm
Please do not force us to create your scenario from scratch
Ease the life of us volunteers.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- ZioPaolo
- Topic Author
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 0
3 years 5 months ago #207752
by ZioPaolo
Replied by ZioPaolo on topic Import multiple question groups at once
Dear Joffm,
you are right and I totally agree. Volunteers are priceless.
Here I attached a (hopefully) self-explanatory example survey.
I also attached the group I need to multiply several times.
Try to import it only once and you will see the expected behaviour.
Then try to import 3 times and you will see the issue that navigating group by group some questions are hidden uncorrectly.
When you arrive to "SUBMIT", only then will appear a validation message and the flows goes back in a lazy way.
you are right and I totally agree. Volunteers are priceless.
Here I attached a (hopefully) self-explanatory example survey.
I also attached the group I need to multiply several times.
Try to import it only once and you will see the expected behaviour.
Then try to import 3 times and you will see the issue that navigating group by group some questions are hidden uncorrectly.
When you arrive to "SUBMIT", only then will appear a validation message and the flows goes back in a lazy way.
Attachments:
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12935
- Thank you received: 3979
3 years 5 months ago #207758
by Joffm
Exactly.
This is usual behaviour. The feature to import groups is not made for this idea.
But in your case a workaround is really easy.
As you use question codes like
"Group2Question1"
"Group2Question2"
...
you only have to change "Group2" to "Group3", import, change to "Group4", import, etc.
This can be done by a small makro in the text editor,
or maybe better create a small program to do this and import by the API.
Sorry, no other idea.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Import multiple question groups at once
the whole behaviour is messy because question codes are not anymore unique.
Exactly.
This is usual behaviour. The feature to import groups is not made for this idea.
But in your case a workaround is really easy.
As you use question codes like
"Group2Question1"
"Group2Question2"
...
you only have to change "Group2" to "Group3", import, change to "Group4", import, etc.
This can be done by a small makro in the text editor,
or maybe better create a small program to do this and import by the API.
Sorry, no other idea.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
3 years 5 months ago #207764
by DenisChenu
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.
Replied by DenisChenu on topic Import multiple question groups at once
An alternative can be :
1. Export as TSV
2. Remove the 1st column (id) that broke easy update
3. Copy the lines you need
4. Update the code
5. Import TSV agin.
1. Export as TSV
2. Remove the 1st column (id) that broke easy update
3. Copy the lines you need
4. Update the code
5. Import TSV agin.
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.