Welcome to the LimeSurvey Community Forum

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

Can I show limited options in multiple choice in limesurvey?

  • YUANSN
  • YUANSN's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 10 months ago #184957 by YUANSN
Hi guys,

I am new to limesurvey and now I am facing some problem carrying a user test. I wonder if it is possible to only display limited options to users, but they are from different categories?

For example, I have options from catgeory A(a1,a2,a3,a4), B(b1,b2,b3,b4,b5) and C(c1,c2,c3,c4,c5,c6,c7,c8), I would like to drag randomly of three options from each category, which means I only show 9 options to each participant, such as displaying (a1,a3,a4,b2,b4,b5,c6,c7,c8) to one participant. Is this possible to complete within limesurvey?

Thank you in advance for your attention!
The topic has been locked.
  • holch
  • holch's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 10 months ago #184984 by holch
You might be able to achieve something like this via Javascript.

Depending on what you are trying to do and how "random" this must work, you could create a couple of different options of this question and create your own different multiple choice questions, e.g.

Q1a: a1, a3, a4, b1, b3, b5, c1, c3, c5
Q1b: a2, a3, a4, b2, b4, b6, c2, c4, c7
etc.

And then create a random number that will define which of these question variations will be actually shown.

Probably not exactly what you are looking for, but the closest I can currently come up with.

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.
  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 9 months ago #184987 by Joffm
Hi,
what type of question is it?
multiple? array?

You can do this by Expression Manager:
1. According to your post (A(a1,a2,a3,a4), B(b1,b2,b3,b4,b5) and C(c1,c2,c3,c4,c5,c6,c7,c8)) create three strings (S1="abcd", S2="efghi" and S3="jklmnopq"). Of course you are free to use different characters)
2.
a. create ONE random number (1-4) to remove one character from S1 (as you have only four options here, it is sufficient to remove one character)
b. create TWO random numbers (1st: 1-5, 2nd: 1-4) to remove two characters from S2.
c. create THREE random numbers (1st: 1-8, 2nd: 1-7, 3rd: 1-6) to capture three characters of S3.
3. Join your three strings to S0.
4. Now you can use relevance equation like "strpos(S0,"f")>0"

You have to use these functions:
rand
strpos
substr
strlen
join

If you send an example (*.lss) I will show you.
At the moment I haven't enough time to create a survey by myself.

Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • YUANSN
  • YUANSN's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 9 months ago #184999 by YUANSN
Hi! I think it might not be exactly what I am looking for, but thanks anyway!
The topic has been locked.
  • YUANSN
  • YUANSN's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 9 months ago #185000 by YUANSN
Hi Joffm, thank you so much for your answering !
But I also would like to ask: is this to be wrritten in the template? Also, if I show randomly the option to each partcipant(which means every questionnaire is different), is that still possible to export each questionnaire which is shown to all the participants?
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 9 months ago #185022 by Joffm
Hi,
unfortunately you did not provide a sample of your tries (*.lss)

1. There are only 4 possible options to display category A (4 over 3)
Therefore I did it just by creating a random number (1-4)

2. There are only 10 possible options to display category B (5 over 3)
Therefore I did it just by creating a random number (1-10)

3. Here you have 56 different ways to diplay your three options (8 over 3).
Here I used the way I described before,

Example:

File Attachment:

File Name: limesurvey...2631.lss
File Size:33 KB



[hr]


Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: holch
The topic has been locked.
  • holch
  • holch's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 9 months ago #185023 by holch
Wow, Joffm... *thumbsup*

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.
  • YUANSN
  • YUANSN's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 9 months ago #185033 by YUANSN
Hi Joffm!

I am soooooo sorry about wasting your time :( I was not sure whether if I can download the survey showed to people or not. I downloaded your work and I modified for my actual need, but it turns out to be problematic...

So the actual case is that:

category A : a1-a4, I used a,b,c,d as well

category B : b1-b9, I used e,f,g,h,i,j,k,l,m

category C : c1-c8, I used n,o,p,q,r,s,t,u

But the preview is not what I think it should be...

The attachment is the survey I made, just want to say sorry again of bothering you.

File Attachment:

File Name: limesurvey...29-2.lss
File Size:43 KB
The topic has been locked.
  • YUANSN
  • YUANSN's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 9 months ago #185171 by YUANSN
Hi Joffm!

Sorry to bother you again...

I managed to complete it on my real task but there is a problem of your method. The r3c sometimes is null, then sometimes it only shows 8 options insetad of 9 options... the attachment is the screenshot I made (and I displayed r3a, rb, r3c to clearly demonstrate the problem)
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 9 months ago #185175 by Joffm
Hi,
in your sample you changed the scenario,
In your first post you said:

A(a1,a2,a3,a4), B(b1,b2,b3,b4,b5) and C(c1,c2,c3,c4,c5,c6,c7,c8)


In your sample it is:
A(a1,a2,a3,a4),
B(b1,b2,b3,b4,b5,b6,b7,b8,b9),
C(c1,c2,c3,c4,c5,c6,c7,c8)

Okay, I saw that you adapted the logic; but at the moment I am too busy with something else.
In the meantime: Set all questions to visible and write down the results of each equation.
Maybe you are able to see under which condition your issue happens.

Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 9 months ago #185178 by Joffm
Hi,

in my opinion you did not fully understand the logic.
Here you capture the character that was delected in "r21"
if(r21 == 1, 'e', if(r21 == 2, 'f', if(r21 == 3, 'g', if(r21 == 4, 'h', if(r21 == 5, 'i', if(r21 == 6, 'j', if(r21 == 7, 'k', if(r21 == 8, 'l', 'm'))))))))
Afterwards this character isn't in the set anymore.
But your next equation is:
if(r21 == 1, 'efghijkl', if(r21 == 2, 'efghijkm', if(r21 == 3, 'efghijlm', if(r21 == 4, 'efghiklm', if(r21 == 5, 'efghjklm', if(r21 == 6, 'efgijklm', if(r21 == 7, 'efhijklm', if(r21 == 8, 'eghijklm', 'fghijklm'))))))))

Of course you have to remove the character that was selected before
if(r21 == 1, 'fghijklm', if(r21 == 2, 'eghijklm', if(r21 == 3, 'efhijklm', if(r21 == 4, 'efgijklm', if(r21 == 5, 'efghjklm', if(r21 == 6, 'efghiklm', if(r21 == 7, 'efghijlm', if(r21 == 8, 'efghijkm', 'efghijkl'))))))))
It's just the other way.;)

I think it's the same in the next equation for catagory C.

Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • YUANSN
  • YUANSN's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 9 months ago #185180 by YUANSN
Hi! Thank you so much for your reply!:laugh:
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose