Welcome to the LimeSurvey Community Forum

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

random question

  • violass
  • violass's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 4 months ago #145926 by violass
random question was created by violass
Hi,
I have a multiple choice question, for example
Q1. What's your favourite fruit?
1) apple
2) orange
3) banana
4) pear

I need that appear two questions randomly selected as array type.
All questions are on separate pages.

Thanks
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 4 months ago #145935 by tpartner
Replied by tpartner on topic random question
If I get your question correctly, you may be able to use a modification of this workaround to select two random responses from a multiple choice question - www.limesurvey.org/forum/can-i-do-this-w...?limitstart=0#143140

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • violass
  • violass's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 4 months ago #145941 by violass
Replied by violass on topic random question
Thanks!
I try the "Demo - Select 2 Random Options From Multi-Choice (ID:264794)" but it doesn't work.

Sorry but I don't know the java language. :laugh:
Can you tell me what I have to modify?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 4 months ago #145953 by tpartner
Replied by tpartner on topic random question

I try the "Demo - Select 2 Random Options From Multi-Choice (ID:264794)" but it doesn't work.

It works for me in LS version 2.57.1.

What LimeSurvey version are you using?

Are there any JavaScript errors in the console?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • violass
  • violass's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 4 months ago #145956 by violass
Replied by violass on topic random question
Now it works in LS version 2.50+.

Thank you!
The topic has been locked.
  • violass
  • violass's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 4 months ago #145970 by violass
Replied by violass on topic random question
All my questions are on separate pages. How can I modify script?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 4 months ago - 7 years 4 months ago #145972 by tpartner
Replied by tpartner on topic random question
You can't, JavaScript can only work on questions within a single page.

Run the survey in group-by-group and place all questions except the hidden one in separate groups.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 7 years 4 months ago by tpartner.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 4 months ago #145993 by DenisChenu
Replied by DenisChenu on topic random question
I don't understand :
- select X fruit
- Show 2 array question at random

What is the relation ?

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • violass
  • violass's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 4 months ago #146001 by violass
Replied by violass on topic random question
Ok, I understand!

I run the survey in group-by-group and now it works.

Thank you again.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose