Welcome to the LimeSurvey Community Forum

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

How to randomly show questions under previous random restrictions?

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago - 3 years 4 months ago #225353 by Joffm
I think you misunderstood this

As the order of the characters is not important for the first part of your survey (there is only asked "does the string contain the character?) you may randomize the order.

That was meant that we usually have an order of "WGN(LST)". But you may change to something else "NG(LST)W", or so.

Not to randomize the switches.


And your new idea?
Easy to realize by a question of type "long text" where you enter your scheme as default answer; each line in a row.
Then you may use the SAVEDID to select the row by a function like (substr(Q0,(SAVEDID-1)*10,8) (not really tested)

Are you able to read German? Anyway, there is Google translate.
You may read this
[url] forums.limesurvey.org/forum/german-forum...ragen-gruppen#211405 [/url]

In short: Both methods are at the end not better than a random selection of one of the 24 rows.
Meaning, you can create a random number (1-24) to select your row.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 3 years 4 months ago by Joffm.

Please Log in to join the conversation.

  • xueting
  • xueting's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 4 months ago #225370 by xueting
Thanks a lot for offering those methods.

Before trying the new ideas, I was still wondering how to realize the former idea: 2 questions randomly go to each trip if 4 trips reported. Now I deleted the randomization for switch questions, and got the following results for trips WGNL: WGNLWGNL, I was wondering how to randomize the order? The new lss. file is attached. Many thanks.
 

File Attachment:

File Name: limesurvey... (1).lss
File Size:208 KB

Regards,
Xueting

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #225372 by Joffm

I was wondering how to randomize the order?

You are working with LimeSurvey for a long time now. You should know that it is not possible because you had to order two groups in the same way.

1. I already wrote

That was meant that we usually have an order of "WGN(LST)". But you may change to something else "NG(LST)W", or so.

This is easy done with a random number and a nested "IF" in eqWGNGroups to join in different orders.
Then (LST) is still the last one.
But you may insert this last character at a different place of the string by 
joining a random substring of WGN, the (LST), the rest of WGN.
Like (a rough idea in the evening)
a. eqRandInsert: {if(is_empty(eqRandInsert),rand(0,eqNumWGN),eqRandInsert)}
b. eqGroupsFinal: {join(substr(eqWGNGroups,0,eqRandInsert),eqLSTGroupsFinal,substr(eqWGNGroups,eqRandInsert))}
Just try.
This will give you a random sequence of four (or three). But it is repeated twice.
In my opinion this is sufficient.
 
2. Use a javascript snippet to create a random string.
a. Create two random strings of all 6 characters and join them. (javascript snippet)
b. According to the answers of the participant remove the not mentioned of WGN and the not selected from LST.
Example:
The random string is "GSNLWTSWLGNT"
eqGroupsFinal is "WGNS"
Now remove all characters from the random string that are not in eqGroupsFinal. functions "strpos" and "str_replace".
You get: "GSNWSWGN".

3. Find a different question type for switch instead "list(radio). A type where you can use "subquestion relevance" to avoid the hidden multiple and the equation.
This way you may have s1 and switch1 in one group and can randomize them.
But in my opinion s1 and switch1 shouldn't be on the same screen.
So a display "question by question" might be better.
In an online survey it is always advisable to have only one question on one screen.

Conclusion:
1. sufficient, uses the existing equations.
2. creates a fully randomized string.
3. is the easiest to implement.

So, be creative, use your brains. You may use all implemented functions.
It is your survey.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: xueting

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #225376 by Joffm
Addition to 2.
Without javascript you may create the string as you proposed in your table.
Create a random number (1-24) and with the "usual" nested IF create the string, like
{if(randnum==1,"WGNLSTTSLNGW",if(randnum==2,"GNWSTLLTSWNG",if...

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: xueting

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #225385 by Joffm
Another addition:
Solution 2 works fine.

Two more hints:
In my opinion you should consider to exchange the letters "A", "B", "C",... to "W", "G", "N",... that it is better memorizable and you avoid this
{if(substr(string,0,1)=="A","W",if(substr(string,0,1)=="B","G",if(substr(string,0,1)=="C","N",if(substr(string,0,1)=="D","L",if(substr(string,0,1)=="E","S","T")))))}
Only {substr(string,0,1)}

your long IF orgia in "string" would have been shorter by joining 8 times.
You use the function "substr" and take the first 8 characters; so no matter how long the string is.
Of course you may use "substr" to shorten it ("{substr(join(x,x,x,x,...),0,8)}")

Joffm

By the way:
Do you have a LimeSurvey user group at TUE?
Shouldn't it be advisable?
Many of your fellow students appeared here, asked questions, got answers.
So there is a pool of knowledge in Eindhoven that should be worth to be shared.

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: xueting

Please Log in to join the conversation.

  • xueting
  • xueting's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 3 months ago #225428 by xueting
Thank you Joffm for taking your evening time to help me. I appreciate the hard work and effort that you put into my issue.

I assumed that maybe adding one more equation and the random would be realized. But after seeing your step-by-step instruction I realized it's not as simple as that. I apologize for taking it for granted.

As you see, I have been working on my survey for a very long time, revising it over and over again with growing anxiety, which sometimes makes me rush the process, while I shouldn’t. No background in programing also makes it difficult for me to master the approaches quickly. I would appreciate your understanding regarding this matter.

I’m really impressed by your multi-perspective thinking to solve a problem, which truly inspired me to think as scientific as possible, and from that I saw learning can actually be interesting, thank you for all the wisdom and passion you shared.

RE: Do you have a LimeSurvey user group at TUE?
There seems not, while there should be I think. I was suggested by fellow students to search answers or ask questions in the forum. I just wanted to let you know how special and appreciated you volunteers are by many of us.

Thanks again for your patience.

Regards,
Xueting

Please Log in to join the conversation.

  • xueting
  • xueting's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 3 months ago #225430 by xueting
Hi Joffm,

May I make sure an issue regarding the 1st method of the German post please? Thanks.
forums.limesurvey.org/forum/german-forum...ragen-gruppen#211405

I was wondering in which following way the sequential number SAVEDID is generated?

1) Once a person open the link the sequential number would be genetated;
2) Once a person finish the survey the sequential number would be genetated.

I suppose if the 1st way, then seems the method is plausible; while if it’s the 2nd way, the pitfall exists -‘as long as the first participant has not completed their survey, all the following participants will also end up in group 1’.

Regards,
Xueting

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 3 months ago #225433 by tpartner
The response ID is generated when the row is added to the data table - after the first survey page is submitted.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: xueting

Please Log in to join the conversation.

  • xueting
  • xueting's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 3 months ago #225442 by xueting
Thank you tpartner for your prompt reply.

If I understand correctly, it's the 2nd way: once a person submits the survey the sequential number would be generated.

Regards,
Xueting

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
3 years 3 months ago #225444 by DenisChenu
No,
SAVEDID generated just after the welcome page (the 1st next button action).
And sometimes can be generated at the welcome page (LimeSurvey version issue).

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The following user(s) said Thank You: xueting

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 3 months ago #225446 by Joffm
Hi,
because you addressed me and mentioned this small "tutorial" in the German part:
All others wrote already, it is generated at the start.
Otherwise there wouldn't be a key to save the data.
And, of course, try it.
Activate a small survey, start it and close the browser tab.
In the answer table you will find this record (with the "id")

Joffm

 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: xueting

Please Log in to join the conversation.

  • xueting
  • xueting's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 3 months ago #225447 by xueting
Understand. Thank you Joffm!

Regards,
Xueting

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose