- Posts: 23
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Export the order of question options
- nadica123
- Topic Author
- Offline
- Junior Member
Less
More
4 months 2 weeks ago #253225
by nadica123
Export the order of question options was created by nadica123
Please help us help you and fill where relevant:
Your LimeSurvey version: [see right hand bottom of your LimeSurvey admin screen]
Own server or LimeSurvey hosting:
Survey theme/template:
==================
(Write here your question/remark)
Hello,
I would like to know if it's possible to export the order of which answer options are displayed to a respondent, since I have questions where the answer options are rotating each time the question is opened. I'm not seeing such option in the export menu of the survey. Does that mean it is not possible?
Thank you.
Your LimeSurvey version: [see right hand bottom of your LimeSurvey admin screen]
Own server or LimeSurvey hosting:
Survey theme/template:
==================
(Write here your question/remark)
Hello,
I would like to know if it's possible to export the order of which answer options are displayed to a respondent, since I have questions where the answer options are rotating each time the question is opened. I'm not seeing such option in the export menu of the survey. Does that mean it is not possible?
Thank you.
Please Log in to join the conversation.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
4 months 2 weeks ago #253230
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 Export the order of question options
There is no built-in facility for that. You will need to use JavaScript to write the order to a hidden question.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Please Log in to join the conversation.
- Joffm
- Away
- LimeSurvey Community Team
Less
More
- Posts: 12941
- Thank you received: 3979
4 months 2 weeks ago #253232
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Export the order of question options
My question is "Why do you display answer options in random order?"
Answer: To avoid a bias because of the order.
In this case it is not necessary to know anything about the order.
OR:
Your goal is to analyse the effect of different orders.
Let's say there are 6 answer options.
You will get 720 different ways they are displayed.
How will you analyse this.
Here you should create a controlled scenario.
Meaning: You define some orders, which you are interested in (option 2 before option 4 vs option 2 after option 4, etc.)
Then you display these different questions by a random number.
Joffm
Answer: To avoid a bias because of the order.
In this case it is not necessary to know anything about the order.
OR:
Your goal is to analyse the effect of different orders.
Let's say there are 6 answer options.
You will get 720 different ways they are displayed.
How will you analyse this.
Here you should create a controlled scenario.
Meaning: You define some orders, which you are interested in (option 2 before option 4 vs option 2 after option 4, etc.)
Then you display these different questions by a random number.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Please Log in to join the conversation.
- nadica123
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 23
- Thank you received: 0
4 months 2 weeks ago #253237
by nadica123
Replied by nadica123 on topic Export the order of question options
Thank you for your answer,
This was a request by the client for which the survey was made, as they wanted to have the order of the options besides the answers in the exported file, for what purpose I am not sure.
Since they didn't have any special requests regarding the order I'm assuming they just wanted to avoid bias.
Have a nice day!
This was a request by the client for which the survey was made, as they wanted to have the order of the options besides the answers in the exported file, for what purpose I am not sure.
Since they didn't have any special requests regarding the order I'm assuming they just wanted to avoid bias.
Have a nice day!
Please Log in to join the conversation.
- nadica123
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 23
- Thank you received: 0
4 months 2 weeks ago #253238
by nadica123
Replied by nadica123 on topic Export the order of question options
Hi,
the question is not hidden, so not sure what you meant by hidden question. Will JavaScript work for regular questions?
How do you suggest this script to be implemented, for each question individually?
Thank you.
the question is not hidden, so not sure what you meant by hidden question. Will JavaScript work for regular questions?
How do you suggest this script to be implemented, for each question individually?
Thank you.
Please Log in to join the conversation.
- Joffm
- Away
- LimeSurvey Community Team
Less
More
- Posts: 12941
- Thank you received: 3979
4 months 2 weeks ago #253241
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Export the order of question options
As you do not want to display this order to the respondent, you have to hide the question.you meant by hidden question.
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Please Log in to join the conversation.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
4 months 2 weeks ago - 4 months 2 weeks ago #253249
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 Export the order of question options
Yes, you would need a hidden question for every question you want the order recorded for.How do you suggest this script to be implemented, for each question individually?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 4 months 2 weeks ago by tpartner.
Please Log in to join the conversation.
- Joffm
- Away
- LimeSurvey Community Team
Less
More
- Posts: 12941
- Thank you received: 3979
4 months 2 weeks ago #253251
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Export the order of question options
You can use this script
Place your hidden question of type "short text" right after the question in the same group.
Place this code into the question
Joffm
Place your hidden question of type "short text" right after the question in the same group.
Place this code into the question
Code:
$(document).on('ready pjax:scriptcomplete',function(){ //Identify the questions var thisQuestion = $('#question{QID}'); var hiddenQuestion = $(thisQuestion).nextAll('.text-short:eq(0)'); // Create an array of answer codes var answerCodes = []; $('li.answer-item', thisQuestion).each(function(i) { answerCodes.push($(this).attr('id').split('X{QID}')[1]); }); // Load the hidden question $('input:text', hiddenQuestion).val(answerCodes); }); </script>
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Please Log in to join the conversation.
- nadica123
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 23
- Thank you received: 0
4 months 2 weeks ago #253300
by nadica123
Replied by nadica123 on topic Export the order of question options
Thank you Joffm,
I will try this.
I will try this.
Please Log in to join the conversation.
- nadica123
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 23
- Thank you received: 0
4 months 2 weeks ago #253305
by nadica123
Replied by nadica123 on topic Export the order of question options
This code doesn't work for me, I added it in the code for the short text hidden question, but I end up with empty field where the order should be written.
I am using this version 6.3.4+231108
Not sure why it doesn't record the order in the question
I am using this version 6.3.4+231108
Not sure why it doesn't record the order in the question
Please Log in to join the conversation.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11660
- Thank you received: 2742
4 months 2 weeks ago #253316
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Export the order of question options
How do you hide the question? Via the GUI with "always hide this question"?
This won't work because if the question is hidden this way, it does not appear in the source code and thus Javascript can not write to it.
This won't work because if the question is hidden this way, it does not appear in the source code and thus Javascript can not write to it.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Please Log in to join the conversation.
- Joffm
- Away
- LimeSurvey Community Team
Less
More
- Posts: 12941
- Thank you received: 3979
4 months 2 weeks ago #253343
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Export the order of question options
Just to prove that it works.
Here in fruity 23
I hope you did not forget to add the starting <script> tag.
Joffm
Here in fruity 23
I hope you did not forget to add the starting <script> tag.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu
Please Log in to join the conversation.