- Posts: 6
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Randomize questions ACROSS groups
- rita.c
- Topic Author
- Offline
- New Member
Less
More
1 month 1 week ago #258836
by rita.c
Randomize questions ACROSS groups was created by rita.c
Hello! I used the procedure
in this forum
to automatically select my questions from a list. Now I have groups of questions, but I don't want my survey to display them. I want all questions in the survey to be randomized, regardless of the group. Could you help me? Thanks a lot.
Please Log in to join the conversation.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12942
- Thank you received: 3979
1 month 1 week ago #258837
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Randomize questions ACROSS groups
You want to display ALL questions in randomized order?
Just enter the same randomization group name to all.
Joffm
Just enter the same randomization group name to all.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Please Log in to join the conversation.
- rita.c
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
- Thank you received: 0
1 month 1 week ago #258838
by rita.c
Replied by rita.c on topic Randomize questions ACROSS groups
I would like to randomize all the displayed questions. The problem is that my questions already have a randomization label that randomly select them from three different groups. Thanks!
Please Log in to join the conversation.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12942
- Thank you received: 3979
1 month 1 week ago #258839
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Randomize questions ACROSS groups
Better you send the lss export of your survey.
Joffm
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Please Log in to join the conversation.
- rita.c
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
- Thank you received: 0
1 month 1 week ago - 1 month 1 week ago #258840
by rita.c
Replied by rita.c on topic Randomize questions ACROSS groups
Sure, thanks! Here it is. For now, I just have two main groups (and two hidden).
Last edit: 1 month 1 week ago by rita.c.
Please Log in to join the conversation.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12942
- Thank you received: 3979
1 month 1 week ago #258842
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Randomize questions ACROSS groups
Bene,
at the moment you see 8 of your 16 "target" questions and 8 of your 16 "negative" questions. By entering a randomization group name on group level you could randomize the order of "target" and "negative".
Or do you want to select 8 "target" questions and 8 "negative" questions and then display all 16 in randomized order?
To do this you have to use a different approach.
If you have rights to use javascript, you can do it with one question of type "short text" and a script.
If you have no rights, it is also possible with some (a lot of ) questions of type equation.
You did not answer the questions at the beginning about your version, about the place of hosting,
So, please, tell us.
To test if you may use javascript, enter in the question text (in source code mode)
If you see the popup, fine.
Joffm
at the moment you see 8 of your 16 "target" questions and 8 of your 16 "negative" questions. By entering a randomization group name on group level you could randomize the order of "target" and "negative".
Or do you want to select 8 "target" questions and 8 "negative" questions and then display all 16 in randomized order?
To do this you have to use a different approach.
If you have rights to use javascript, you can do it with one question of type "short text" and a script.
If you have no rights, it is also possible with some (a lot of ) questions of type equation.
You did not answer the questions at the beginning about your version, about the place of hosting,
So, please, tell us.
To test if you may use javascript, enter in the question text (in source code mode)
Code:
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ alert("Hello, javascript speaking"); }); </script>
If you see the popup, fine.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Please Log in to join the conversation.
- rita.c
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
- Thank you received: 0
1 month 1 week ago #258844
by rita.c
Replied by rita.c on topic Randomize questions ACROSS groups
I aim to select 8 "target" questions and 8 "negative" questions, and then display all 16 in a randomized order. However, I encountered an issue in the "script" section of the "short text" question, displaying the message "You do not have sufficient permissions to update the script." I am utilizing the LimeSurvey Community Edition Version 6.3.1+231023 provided by my university. Thanks a million for your help!
Please Log in to join the conversation.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12942
- Thank you received: 3979
1 month 1 week ago #258845
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Randomize questions ACROSS groups
HM,
yeah, university installation. They usually forbid javascript.
Bad luck, because I had a short nice solution.
So we go with the equations.
It will be a bit longer, but fortunately it is rather straightforward.
I will create it and send your survey back; but please allow some time.
Now I have to go and buy something for our evening meal.
Till tomorrow morning.
Joffm
yeah, university installation. They usually forbid javascript.
Bad luck, because I had a short nice solution.
So we go with the equations.
It will be a bit longer, but fortunately it is rather straightforward.
I will create it and send your survey back; but please allow some time.
Now I have to go and buy something for our evening meal.
Till tomorrow morning.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Please Log in to join the conversation.
- rita.c
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
- Thank you received: 0
1 month 1 week ago #258847
by rita.c
Replied by rita.c on topic Randomize questions ACROSS groups
Grazie! You're very kind. I hope it doesn't take too much of your time. Here's the survey with all three groups: "target," "negative," and "positive."
In the version to be administered, I'll need 8 target questions taken from "target" and "target hidden"; 9 negative taken from "negative" and "negative hidden"; and 9 positives taken from "positive" and "positive hidden".
The hidden version has the same questions but a slightly different text. So, if T1n is shown (group "target"), the correspondent T1p (group "target hidden") should not be displayed. I have a feeling this is very complicated...
In the version to be administered, I'll need 8 target questions taken from "target" and "target hidden"; 9 negative taken from "negative" and "negative hidden"; and 9 positives taken from "positive" and "positive hidden".
The hidden version has the same questions but a slightly different text. So, if T1n is shown (group "target"), the correspondent T1p (group "target hidden") should not be displayed. I have a feeling this is very complicated...
Please Log in to join the conversation.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12942
- Thank you received: 3979
1 month 1 week ago #258848
by Joffm
My rough idea is:
Create a string with 8 pairs of elements (16 in total)
Create a random number from 1 to the length of the string
Capture the element
Remove the element AND the corresponding element
Create a random number from 1 to the length of the (now shorter) string
Capture the element
Remove the element AND the corresponding element
...
We'll see.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Randomize questions ACROSS groups
Yes, this is.So, if T1n is shown (group "target"), the correspondent T1p (group "target hidden") should not be displayed. I have a feeling this is very complicated...
My rough idea is:
Create a string with 8 pairs of elements (16 in total)
Create a random number from 1 to the length of the string
Capture the element
Remove the element AND the corresponding element
Create a random number from 1 to the length of the (now shorter) string
Capture the element
Remove the element AND the corresponding element
...
We'll see.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Please Log in to join the conversation.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12942
- Thank you received: 3979
1 month 1 week ago #258867
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Randomize questions ACROSS groups
Hi,
as promised, my solutions.
I send three different solutions in ascending order
1. This survey maintains your "question by question" design.
But you have to pay for it.
To calculate the 3x8 displayed questions you need 96 equations.. This way the progressbar starts at about 70% (Do not show it.)
2. The other suveys are displayed in "group by group" design.
But to keep the "golden rule" of online surveys (one question per page) there is only one question in each group.
The advantage is, that now you can place all equations in one question and use a "container" to store the interim results.
Both use the same idea to calculate your questions.
First we create a string "ABCDEFGHabcdefgh" (8 capital letters and 8 small letters to symbolize the 8 pairs)
Now we start by creating a random number from 1 to the length of the string (1-16). Let's say, we get 12.
We grab the letter at position 12 ("d") and store it.
Now we remove both this lowercase letter "d" and the uppercase letter "D".
The remaining string is "ABCEFGHabcefgh"
And we start again by creating a random number from 1 to the length of the string (now 1-14)
At the end we jopin all single letter to the result string ("sRes") like "#dCHaBGeF"
And later we display the questions with the condition "strpos(sRes,'d')>0".
Meaning if the string contains the letter, the question is displayed.
The "#" is used to avoid a result of "0".; "strpos" starts counting at "0".
But "0" also means "not found".
3. This idea is similar to your first with the two groups (one visible, one hidden)
But here each pair of groups only contains the two paired questions.
Because of the same randomization group name of the question one of them is displayed.
And all groups get the same randomization group name on group level.
So all are displayed in randomized order.
Disadvantage: In groups "negative" and "positive" there are 9 pairs. So
9 questions are displayed
You could avoid this by counting the appearance.
In my opinion the last is the best.
But I wanted to show all three (to be honest: the last came to my mind after I had completed the first two), that you may learn some techniques, some options for your further development of surveys.
Joffm
as promised, my solutions.
I send three different solutions in ascending order
1. This survey maintains your "question by question" design.
But you have to pay for it.
To calculate the 3x8 displayed questions you need 96 equations.. This way the progressbar starts at about 70% (Do not show it.)
2. The other suveys are displayed in "group by group" design.
But to keep the "golden rule" of online surveys (one question per page) there is only one question in each group.
The advantage is, that now you can place all equations in one question and use a "container" to store the interim results.
Both use the same idea to calculate your questions.
First we create a string "ABCDEFGHabcdefgh" (8 capital letters and 8 small letters to symbolize the 8 pairs)
Now we start by creating a random number from 1 to the length of the string (1-16). Let's say, we get 12.
We grab the letter at position 12 ("d") and store it.
Now we remove both this lowercase letter "d" and the uppercase letter "D".
The remaining string is "ABCEFGHabcefgh"
And we start again by creating a random number from 1 to the length of the string (now 1-14)
At the end we jopin all single letter to the result string ("sRes") like "#dCHaBGeF"
And later we display the questions with the condition "strpos(sRes,'d')>0".
Meaning if the string contains the letter, the question is displayed.
The "#" is used to avoid a result of "0".; "strpos" starts counting at "0".
But "0" also means "not found".
3. This idea is similar to your first with the two groups (one visible, one hidden)
But here each pair of groups only contains the two paired questions.
Because of the same randomization group name of the question one of them is displayed.
And all groups get the same randomization group name on group level.
So all are displayed in randomized order.
Disadvantage: In groups "negative" and "positive" there are 9 pairs. So
9 questions are displayed
You could avoid this by counting the appearance.
In my opinion the last is the best.
But I wanted to show all three (to be honest: the last came to my mind after I had completed the first two), that you may learn some techniques, some options for your further development of surveys.
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.
- rita.c
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
- Thank you received: 0
1 month 1 week ago #258869
by rita.c
Replied by rita.c on topic Randomize questions ACROSS groups
Hi,
I really appreciate your help, thanks a million! The third option works perfectly and the process is easier to understand since I'm not very familiar with strings and equations.
All the best (really ),
Rita
I really appreciate your help, thanks a million! The third option works perfectly and the process is easier to understand since I'm not very familiar with strings and equations.
All the best (really ),
Rita
Please Log in to join the conversation.