Welcome to the LimeSurvey Community Forum

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

Show question randomly

  • DeExperimenter
  • DeExperimenter's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 10 months ago #200100 by DeExperimenter
Show question randomly was created by DeExperimenter
Hey all!

Newbie here. I have set up a Lime survey and I want to randomly show a question out of 6 possible questions. The question is only a 'display text' message with a particular link.

The set-up of my design is as follows: The participant arrives at the survey, confirms the informed consent, then is shown a link to an altered website. There are 6 conditions, which affect the interface of the website, so there are 6 different links (one to each altered website).

So what I tried to do, as was proposed in this tutorial:
survey-consulting.com/how-to-randomly-sh...a-limesurvey-survey/

is first have a hidden question group with an 'equation' question in it (for test purposes only 2 conditions)
{if(is_empty(randnumber.NAOK),rand(1,2),randnumber.NAOK)}
in the question field.
I also tried putting it in the 'logic' equation field, but both failed.

Secondly, I have a group 'Show random question' with two 'display text' questions in it
randomQ1 <sample text in question field>
randomQ2 <sample text in question field>

In each of those I put the following in the 'relevance equation' box on the right:
((randnumber.NAOK==”1″))
((randnumber.NAOK==”2″))
respectively.

It gave me an error, because of the quotation marks. I removed them, but I also tried it with the quotation marks still in place. When they're in place both questions show up. When they're not in place no questions show up. I also tried to change the number in the equation to rand(0,2), to see if maybe it pick a number between 0 and 2, which is only 1. But no...


I also tried putting the following in the relevance equation field:
randnumber==1
randnumber==2
also with quotation marks. I have also tried removing (()). I have tried using the 'SetConditions' option for the random questions and select the randnumber as a condition. None seems to work so far...

So... Yeah! Help! I have provided pictures in the attachments. (Note: the standard text on my page is a display text question saying "Well, not really random, but showing up?" to see if the page was loading.)

Thanks :)
Some Dutch experimenter
The topic has been locked.
  • DeExperimenter
  • DeExperimenter's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 10 months ago #200102 by DeExperimenter
Replied by DeExperimenter on topic Show question randomly
Oh and I also tried testing it when the survey was active, as some people said some logic might only work if it's activated, but unfortunately that didn't do the trick :).
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #200103 by holch
Replied by holch on topic Show question randomly
I don't see any problem in your code on the screenshots.

Could you export your example as LSS file (including only the relevant questions)?

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #200105 by holch
Replied by holch on topic Show question randomly
What does your equation question show? Does it generate the random number or what does it show? That would be my first test to see where the problem is.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • DeExperimenter
  • DeExperimenter's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 10 months ago #200124 by DeExperimenter
Replied by DeExperimenter on topic Show question randomly
I have deleted all question groups except the generator and the 'show random questions', see attachment.
The topic has been locked.
  • DeExperimenter
  • DeExperimenter's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 10 months ago #200125 by DeExperimenter
Replied by DeExperimenter on topic Show question randomly
If I set the generator question to show it remains empty. Should it show the generated number?
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #200130 by Joffm
Replied by Joffm on topic Show question randomly
Hi,
You must not hide the group.

In that case the question "randnumber" isn't rendered at all.

You only hide the question.

Therefore it shouldn't be the only question in the group, because then you display the skeleton of a group without question - only buttons.



File Attachment:

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


Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DeExperimenter
The topic has been locked.
  • DeExperimenter
  • DeExperimenter's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 10 months ago #200142 by DeExperimenter
Replied by DeExperimenter on topic Show question randomly
Thank you! That seems to have caused it :).
Yessss, now I can randomise in peace!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose