Welcome to the LimeSurvey Community Forum

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

Create Randomizer, Embedded Data, and Piping

  • jonny_bingbong
  • jonny_bingbong's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 months ago #208860 by jonny_bingbong
Create Randomizer, Embedded Data, and Piping was created by jonny_bingbong
Hi all,

for a work project I have to create a survey in limesurvey which randomly selects and assigns a participant to 1 of 32 conditions. In this case a condition is the nationality of the outgroup regarding which the participant has to answer questions, e.g. 'To what extent do you believe people with a spanish background are treated fairly in the US?' or 'To what extent do you believe people with an indonesian background are treated fairly in the US?' - once assigned the participant will only answer questions for this specific group.

So far, I have been unable to find a solution for limesurvey for this specific problem. In theory, I would like to have a 'randomiser' at the beginning of the survey which randomly assigns the participant to one of the 32 conditions. Then, I would use embedded data - which I need to define as the specific nationalities - to pipe the randomly chosen nationalities into each question.

I hope this is clear, and that somebody can help me, since I feel rather stuck at the moment.

Best wishes
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #208862 by Joffm
Hi,
no, it is not clear.
To assign one participant to one of the 32 groups you do the usual.
You create a random number (1-32)
{if(is_empty(randnum),rand(1,32),randnum)}
and select the group by relevance equation.

The other things I do not understand fully.
As usual, the best is to send a lss export of a prototype of your survey.

Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • jonny_bingbong
  • jonny_bingbong's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 months ago #208873 by jonny_bingbong
Replied by jonny_bingbong on topic Create Randomizer, Embedded Data, and Piping
Hi,

unfortunately I am not allowed to share any detailed information about the survey due to the ethics procedure of my work.
However, thanks already for the explanation of how to create random conditions. What remains now is to connect each conditions with a nationality, spanish and indonesian in the example above, and to easily fit that into the questions. Is the idea of what I want to do at least clear? And how would you do that?

Thanks for your help.

PS: I got my initial idea from a former colleague with expertise in Qualtrics. I could share the explanation of his if you think it would help to clarify the issue.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #208874 by Joffm
Therefore we ask for a prototype of the survey, not the survey itself.
What we need to help is the structure and the desired workflow.

So you may create this with dummy questions (but the same question types).
The exact wording dosn't matter
It is absolutely unimportant if there are nationalities involved or color of owned cars or number of fingers.


Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu, jonny_bingbong
The topic has been locked.
  • jonny_bingbong
  • jonny_bingbong's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 months ago #208903 by jonny_bingbong
Replied by jonny_bingbong on topic Create Randomizer, Embedded Data, and Piping
Ok, I see. I attached a file that has roughly the same workflow. So, optimally the assignment into random conditions would come after the data privacy agreement, and then the participant would keep this assignment throughout the survey. Right now I wrote "nationality" as a placeholder for the part that should change.

Moreover, I have another smaller problem. I try to use this code: forums.limesurvey.org/forum/can-i-do-thi...-you-can-skip#123388 . However, when I put it right after the question text as is instructed in the manual I do not get the warning message that I would like to see when not all fields have been filled out.

As you may be able to tell by now, I am a relatively new user of limesurvey and already want to apologise for possibly redundant questions.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago - 3 years 4 months ago #208905 by Joffm
Hi,
some question to understand.
You talked about 32 groups.
Where are they?
Is "Part 1" the first of them and there will be "Part 2", "Part 3",...; "Part 32"?

Are the characteristics in B1 always the same? Or not?
Or does only the wording of "nationality" change?
If so you do not need more than one group. You only select the word by "micro-tayloring".

As mentioned in the linked thread this javascript snippet is used in multiple short text" questions.
You use different question types.
And I saw that this script is older than 5 years. So it might not work in version 3.x.

And something else.
You do not use the group relevance "A1.NAOK=="A1" for the rest of the survey.
Use a quota to screen out the participants who don't agree.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 3 years 4 months ago by Joffm.
The following user(s) said Thank You: jonny_bingbong
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago - 3 years 4 months ago #208908 by Joffm
Here an example.
Equation "nat" is not completed. I only entered 20 options to show how it works.

Have a look at the micro-tayloring in Part 1 .

And why not use the built-in privacy policy option instead of this in a first question?

File Attachment:

File Name: limesurvey...1771.lss
File Size:31 KB

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 3 years 4 months ago by Joffm.
The following user(s) said Thank You: jonny_bingbong
The topic has been locked.
  • jonny_bingbong
  • jonny_bingbong's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 months ago #208912 by jonny_bingbong
Replied by jonny_bingbong on topic Create Randomizer, Embedded Data, and Piping
Thanks for your quick response! I will go through the file you have attached in the comment below right away.

But to answer your previous question quickly: My idea was that I could write the survey in a way that only the word "nationality" would always change, since, as you also noted, the questions generally remain the same apart from the nationality. So, do you think micro-tayloring can solve that issue generally or would I still have to write the same questions 32 times (for each outgroup) and then use the relevance equation to assign the randomly picked participants?

The code should also only work for the one question of that type, but I will see if I can find an updated version of the code.

Oh, I did not see that option, I will adjust the privacy policy according to your suggestion.
The topic has been locked.
  • jonny_bingbong
  • jonny_bingbong's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 months ago #208914 by jonny_bingbong
Replied by jonny_bingbong on topic Create Randomizer, Embedded Data, and Piping
I just looked at your file. I think this should solve my main issue. Thank you so very much! I hope I can now finish it by my own might, but may have to write again in case something does not work. Either way, I am already very relieved that you could provide me with an answer to the greatest remaining issue I was having.
The topic has been locked.
  • jonny_bingbong
  • jonny_bingbong's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 months ago #208934 by jonny_bingbong
Replied by jonny_bingbong on topic Create Randomizer, Embedded Data, and Piping
It worked like a charm. I also adjusted the other settings to your suggestions. The only problem that remains now that I still cannot figure out how to set up the warning message which interrupts the 'next' button for the non-mandatory multiple short text question. Would you have an idea how to do it?
I was unable to find a later version of comparable code than the own I had linked in the previous message.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #208948 by Joffm
You see I am not at all familiar with javascript.
So I always try things that I read in other threads in the forum.

1. the IDs #movenextbtn and #movesubmitbtn have changed.
Since version 3.x. it is #ls-button-submit
So change this line
$('#movenextbtn, #movesubmitbtn').bind('click', function () {
to
$('#ls-button-submit').bind('click', function () {

2. This has also changed 'input.text' --> 'input [type="text"]'
So change this line
$('input.text', thisQuestion).each(function(i) {
to
$(''input [type="text"]', thisQuestion).each(function(i) {

And then I see this


But to be honest: And this is my personal opinion and my personal behaviour.
If I get this message, I feel harassed.
Because I had just decided to click "Next"
And then somebody asks me "You have an unanswered item. Do you want to continue?"
YES, I wanted to continue.
In such a case, I would stop the survey immediately.

In my opinion better is a hint "Please, enter up to 10 ...", "as many as possible" or whatever.
And you may enter a validation that checks for "at least 5 answers", like "count(self) ge 5"

Maybe it's a little psychological trick to display line by line.
Then the participant sees a blank line again and again and is encouraged to fill it out.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: tpartner, jonny_bingbong
The topic has been locked.
  • jonny_bingbong
  • jonny_bingbong's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 months ago #208968 by jonny_bingbong
Replied by jonny_bingbong on topic Create Randomizer, Embedded Data, and Piping
Thank you for your help once again. Can you maybe send me the .lss file? It somehow does not work perfectly for me yet.
I agree with your point about feeling harassed, but it actually wasn't my choice, so I am just doing what I was told to do.

Best, Jonathan
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose