Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Randomize questions ACROSS groups

  • rita.c
  • rita.c's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 month 6 days 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
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 6 days ago #258837 by Joffm
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 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • rita.c
  • rita.c's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 month 6 days 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
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 6 days ago #258839 by Joffm
Replied by Joffm on topic Randomize questions ACROSS groups
Better you send the lss export of your survey.
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • rita.c
  • rita.c's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 month 6 days ago - 1 month 6 days 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).

File Attachment:

File Name: limesurvey...7372.lss
File Size:306 KB
Last edit: 1 month 6 days ago by rita.c.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 6 days ago #258842 by Joffm
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)
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
  • rita.c's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 month 6 days 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
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 6 days ago #258845 by Joffm
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

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • rita.c
  • rita.c's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 month 6 days 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...

 

File Attachment:

File Name: limesurvey...72-2.lss
File Size:459 KB

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 6 days ago #258848 by Joffm
Replied by Joffm on topic Randomize questions ACROSS groups

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...

Yes, this is.

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
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 5 days ago #258867 by Joffm
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.)
 

File Attachment:

File Name: limesurvey...6EQQ.lss
File Size:466 KB


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.
 

File Attachment:

File Name: limesurvey...3EGG.lss
File Size:379 KB


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.
 

File Attachment:

File Name: limesurvey...6RGG.lss
File Size:295 KB
 

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
  • rita.c's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 month 5 days 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

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose