- Posts: 16
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Macrosurvey
- biagios
- Topic Author
- Offline
- New Member
Less
More
1 year 6 months ago #232490
by biagios
Replied by biagios on topic Macrosurvey
OK I inserted the string you suggested into the equation question. Where should the survey IDs now be entered? And what do I enter in the end-url?
Please Log in to join the conversation.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12888
- Thank you received: 3965
1 year 6 months ago #232534
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Macrosurvey
Hi,
first: There are HTML tags in your equation "randnum"
So this will not work. Remove them.
You seem to have pasted it. Never do this!
YAour end-url is fine, if the result of "randnum" is a valid surveyID.
At the moment you get only "0", "1", "2".
Here I show two options.
The first I mentioned before:
Create your surveys with these six surveyIDs like
111111
111112
111113
...
Now you can distribute your respondents randomly with an equation like
{if(is_empty(randnum),sum(111110,rand(1,6)),randnum)}
and your end-url is like this
2. Nested IF
Create a random number (1-6) the usual way
{if(is_empty(randnum2),rand(1,6),randnum2)}
In a next equation (eqSID) select the surveyID (linefeeds for easy reading, don't copy/paste)
and the end-url is like
You can put this second equation directly into the end-url field, as described here
[url] manual.limesurvey.org/URL_fields/en#Expressions [/url]
but I do not recommend it.
In the real survey the equations will be hidden, of course.
Joffm
first: There are HTML tags in your equation "randnum"
Code:
<pre> {TOKEN-3*floor(TOKEN/3)} </pre> <p> </p>
You seem to have pasted it. Never do this!
YAour end-url is fine, if the result of "randnum" is a valid surveyID.
At the moment you get only "0", "1", "2".
Here I show two options.
The first I mentioned before:
Create your surveys with these six surveyIDs like
111111
111112
111113
...
Now you can distribute your respondents randomly with an equation like
{if(is_empty(randnum),sum(111110,rand(1,6)),randnum)}
and your end-url is like this
Code:
https://myServer/limesurvey/index.php/{randnum}?lang=it
2. Nested IF
Create a random number (1-6) the usual way
{if(is_empty(randnum2),rand(1,6),randnum2)}
In a next equation (eqSID) select the surveyID (linefeeds for easy reading, don't copy/paste)
Code:
{if(randnum2==1,'123456', if(randnum2==2,'234567', if(randnum2==3,'345678', if(randnum2==4,'456789', if(randnum2==5,'567890','678901') ) ) ) )}
and the end-url is like
Code:
https://myServer/limesurvey/index.php/{eqSID}?lang=it
You can put this second equation directly into the end-url field, as described here
[url] manual.limesurvey.org/URL_fields/en#Expressions [/url]
but I do not recommend it.
In the real survey the equations will be hidden, of course.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Please Log in to join the conversation.
- ScuolaIUSS2019
- Offline
- New Member
Less
More
- Posts: 6
- Thank you received: 0
1 year 6 months ago #232540
by ScuolaIUSS2019
Replied by ScuolaIUSS2019 on topic Macrosurvey
Thank you very much,
I am in the process of constructing the last surveys but I think I have succeeded! I have one last question: how can I make sure that each respondent is randomly assigned to a survey and that each survey is completed by an equal number of participants?
Probably the number should not be random but each entry should be assigned to survey x, the next one to survey y.
I am in the process of constructing the last surveys but I think I have succeeded! I have one last question: how can I make sure that each respondent is randomly assigned to a survey and that each survey is completed by an equal number of participants?
Probably the number should not be random but each entry should be assigned to survey x, the next one to survey y.
Please Log in to join the conversation.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12888
- Thank you received: 3965
1 year 6 months ago #232543
by Joffm
A random number is a random number. But the percentual difference from an equal distribution will be smaller with a high number of participants.
Roll a dice and count, you will see.
{1+SAVEDID-x*floor(SAVEDID/x)}
with x=number of groups.
But it is not better than a random number.
There are always respondents who do not complete a survey.
One more workaround is:
Watch the distribution and if one group is filled you switch the relevance equation.
Before
After group 3 is filled but group 5 is a bit low
Or there is a plugin "getStatInSurvey" by DenisChenu.
[url] gitlab.com/SondagesPro/ExportAndStats/getStatInSurvey [/url]
Here you have a "leastfilled" option.
You see, there are many options.
But these are basics which you can think about yourself.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Macrosurvey
You see the IF-statement. Here you see that ANYBODY is assigned to one of the surveys.how can I make sure that each respondent is randomly assigned to a survey
This is something you can't.and that each survey is completed by an equal number of participants?
A random number is a random number. But the percentual difference from an equal distribution will be smaller with a high number of participants.
Roll a dice and count, you will see.
Instead of a random number you could use the SAVEDID and the same MODULO calculation as before.should not be random but each entry should be assigned to survey x, the next one to survey y.
{1+SAVEDID-x*floor(SAVEDID/x)}
with x=number of groups.
But it is not better than a random number.
There are always respondents who do not complete a survey.
One more workaround is:
Watch the distribution and if one group is filled you switch the relevance equation.
Before
Code:
{if(randnum2==1,'123456', if(randnum2==2,'234567', if(randnum2==3,'345678', if(randnum2==4,'456789', if(randnum2==5,'567890','678901') ) ) ) )}
Code:
{if(randnum2==1,'123456', if(randnum2==2,'234567', if(randnum2==3,'567890', if(randnum2==4,'456789', if(randnum2==5,'567890','678901') ) ) ) )}
Or there is a plugin "getStatInSurvey" by DenisChenu.
[url] gitlab.com/SondagesPro/ExportAndStats/getStatInSurvey [/url]
Here you have a "leastfilled" option.
You see, there are many options.
But these are basics which you can think about yourself.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Please Log in to join the conversation.
- Jmantysalo
- Offline
- Platinum Member
Less
More
- Posts: 348
- Thank you received: 41
1 year 6 months ago #232544
by Jmantysalo
Replied by Jmantysalo on topic Macrosurvey
Answers given by Joffm are good. You can also check
survey.tuni.fi/help/limit-registrations.html
to get an idea about statCountIf()-function, but I think you won't need it.
However, if the survey for some group is faster and easier than for other group, then it is of course possible that you will not get at all similar number of responses for all groups.
However, if the survey for some group is faster and easier than for other group, then it is of course possible that you will not get at all similar number of responses for all groups.
Please Log in to join the conversation.