Welcome to the LimeSurvey Community Forum

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

Macrosurvey

  • biagios
  • biagios's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 7 months ago #232456 by biagios
Macrosurvey was created by biagios
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:
==================
Good morning, 
For a university project, I created 6 surveys on LimeSurvey. I would need to randomly assign subjects to one of the 6 surveys. Is it possible to have Lime Survey randomly assign subjects to one of the 6 surveys? Ideally, I would like to generate a link that once clicked on redirects to one of the 6 surveys. 

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 7 months ago #232459 by Joffm
Replied by Joffm on topic Macrosurvey
Hi, 
at first:
Are you too shy to answer the questions about version, hostin, theme?
You didn't answer them in the Italian part nor did you here.

Now, what are the subjects?
Respondents? Or what?

And is it really necessary to create 6 different surveys instead of 6 groups in one survey?

lfanfoni already asked for a lss export (even if it was a different question)

Please, help us to help you by giving as much information as possible.

Regards
Joffm 

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

Please Log in to join the conversation.

  • biagios
  • biagios's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 7 months ago #232461 by biagios
Replied by biagios on topic Macrosurvey
I apologise,
I had not replied because I enter the form very little and had not received notification of a reply from you.

Regarding my question, yes it is necessary to create 6 different surveys and have the subjects (respondents) randomly assigned to one of these surveys.

Is it possible to possibly create another survey that simply allows respondents to be randomly sent back to one of the 6?

I saw that a similar question has already been asked in the forum: forums.limesurvey.org/forum/can-i-do-thi...random-from-one-link

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 7 months ago - 1 year 7 months ago #232462 by Joffm
Replied by Joffm on topic Macrosurvey
Yes, of course,
easily done.
Create a survey where you creta a random number (1-6) and in the end-url you redirect to the respective survey.
Best is to generate the end-url link also in a question of type "equation" e.g. "eqURL".
In the end-url field you only enter {eqURL}

To generate the link there are several options.
Remember each survey has a different surveyID.

Either a nested IF.
Or you generate the surveyIDs like 
111111
111112
111113
...
Then the final ID is calculated as sum(111110, randnumber).

Joffm
And we still don't know your version.

I did not answer your question in the Italian part because

no screenshot
no lss
no version 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 year 7 months ago by Joffm.

Please Log in to join the conversation.

  • biagios
  • biagios's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 7 months ago #232469 by biagios
Replied by biagios on topic Macrosurvey
I thank you for your answer,
I am a beginner Lime Survey user and am trying to learn.
The version I am currently using is 3.28.24 and I cannot update it for technical reasons.

Regarding my question, I have already created three surveys which have a specific ID. I have created another survey to carry out a random redirection. I have entered {eqURL} in the end-url field but where do I create the random number you are talking about?
I also attach the .Iss file

/Users/biagioscalingi/Downloads/limesurvey_survey_163594.lss

Please Log in to join the conversation.

  • biagios
  • biagios's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 7 months ago #232471 by biagios
Replied by biagios on topic Macrosurvey
P.s. Unfortunately, I cannot upload .Iss files, the upload takes a long time and then is cancelled

Please Log in to join the conversation.

  • biagios
  • biagios's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 7 months ago #232475 by biagios
Replied by biagios on topic Macrosurvey
 

File Attachment:

File Name: limesurvey...94-2.lss
File Size:15 KB


This is what I managed to do. I created an equation question that randomises a number from 1 to 3 (this is because so far I have created 3 out of 6 surveys).
Now how do I associate the number with the respective survey link? 

Please Log in to join the conversation.

More
1 year 7 months ago #232481 by Jmantysalo
Replied by Jmantysalo on topic Macrosurvey
Why not just make one survey, have numbers as tokens, and then put TOKEN-6*floor(TOKEN/6)==0, TOKEN-6*floor(TOKEN/6)==1 etc. as condition for question groups?

Please Log in to join the conversation.

More
1 year 7 months ago - 1 year 7 months ago #232483 by ScuolaIUSS2019
Replied by ScuolaIUSS2019 on topic Macrosurvey
Actually, the ideal would be to do a redirection survey, because each of the 6 surveys has different items and response modes. Furthermore, the possibility of creating a redirection survey could serve for future projects. 
I was able to create an equation question and have it randomly generate a number from 1 to 6. Do I have to enter the id of each survey in the equation question to generate a number from 1 to 6? 
I also tried modifying the end url to associate it with the result of the hidden equation but without success. 

 [
Last edit: 1 year 7 months ago by ScuolaIUSS2019.

Please Log in to join the conversation.

More
1 year 7 months ago #232484 by Jmantysalo
Replied by Jmantysalo on topic Macrosurvey
OK, there are situations where multiple surveys is the key. The code could be

{if(rand(1,3)==1, '123456', if(rand(1,2)==1, '654321', '11223'))}

which means
Code:
if(rand(1,3)==1
then
    '123456'
else
    if(rand(1,2)==1
    then
        '654321'
    else
        '11223'
    endif
endif

And then, if the name of that pseudquestion is 'randnum', end url would be someserver.invalid/limesurvey/{randnum }
 

Please Log in to join the conversation.

  • biagios
  • biagios's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 7 months ago #232485 by biagios
Replied by biagios on topic Macrosurvey
Thank you very much, I set up the survey as follows. Is this correct? When I preview the survey, however, it shows the survey id that is randomly drawn.

 

File Attachment:

File Name: limesurvey...94-3.lss
File Size:15 KB

Please Log in to join the conversation.

More
1 year 7 months ago #232489 by Jmantysalo
Replied by Jmantysalo on topic Macrosurvey
Oh no. rand() is executed every time it is used, so the rand() in the first page is not the same as in the end URL. I think there was a way to overcome this limitation, but can't remember it now.

So, another try... What kind of tokens you use? If consecutive or randon numbers, you can use the TOKEN trick. Maybe easiest is to make a question of type equation having {TOKEN-6*floor(TOKEN/6)}. The use that number in the end URL.

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose