Check out the LimeSurvey source code on GitHub!

Array_filter vs. Expression Manager vs. passing through "other"

More
3 years 5 months ago #99295 by holch
I have 2 question, that depend on each other.

First question is the brands they know (multiple answers possible), the second asks about the brands they use the most (single answer)

So far so good, this is a case for array_filter (which by the way took quite a while to find, because it is in a totally different position in the Eortuguese version as in the English version!!!).

OK. so I set up my questions and this works fine, but I have one problem: There is a "other" option.

And I would like to pass on the answer to the other option, if chosen, to the second questions. So I used Expression Manager to pass on the answer to "other" in my question S9 via
{S9_other}
to my question S9a.

However, my problem now is that there is always a radio button, because the array_filter doesn't recognize the other option from the S9 (because it wasn't there).

So I am no wondering how I can do that. One idea was that I could avoid built in "other" option in S9 and instead create another open question that opens only when a answer item called "other" (different from the standard "other" option from LS) and then pass through the response of that to the next question.

But I think there must be a solution for the built in "other" option well. Any ideas?

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in to join the conversation.

More
3 years 5 months ago #99296 by holch
Here to show what I mean. As nothing is chosen yet in S9, there should be no radio button in S9a.

But as the piped in option from S9_other didn't exist in the first option as a normal answer option, the radio button appears, because the array_filter doesn't manage to catch it of course.


I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds
Attachments:

Please Log in to join the conversation.

More
3 years 5 months ago #99310 by first
I have a quick solution if you are comfortable in displaying both questions on separate screens.

Survey Designer and Programmer
"I always suggest to have a group by group display layout and create a seprate group for each question. This will be extra work but you will get flexiblity to create your question by using more than more lime survey question types."

Please Log in to join the conversation.

More
3 years 5 months ago #99336 by holch
Hi Trivender. In general the questions can be shown on different screens. I would have to restructure the whole survey a little, but...

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in to join the conversation.

More
3 years 5 months ago - 3 years 5 months ago #99344 by first
Good news :), You don't have to restructure the whole survey. After spending some time I found that we can do it on the same page as well. Just use "other" as answer code.Dummy Screen shot is attached.You will see a radio button for "other specify " only when you will enter something in the text box. Enjoy.

Survey Designer and Programmer
"I always suggest to have a group by group display layout and create a seprate group for each question. This will be extra work but you will get flexiblity to create your question by using more than more lime survey question types."
Attachments:
Last Edit: 3 years 5 months ago by first.
The following user(s) said Thank You: holch

Please Log in to join the conversation.

More
3 years 5 months ago #99355 by DenisChenu
Hi,

Maybe it can be great to put this in our workaround wiki :)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).

Please Log in to join the conversation.

More
3 years 5 months ago #99384 by holch
Hey, nice! I will give it a try later on today and see if it works.

This would be great.

I just saw that you used .NOAK, I usually use .SHOWN. Is there any difference?

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in to join the conversation.

More
3 years 5 months ago #99390 by holch
Just a quick feedback: works like a charm. However, please remember that "other" must be written with a small "o" at the beginning. I had "Other" first and it didn't work. I was a little disappointed that it didn't work, but then double checked and found my mistake.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in to join the conversation.

More
3 years 5 months ago #99399 by DenisChenu

holch wrote: I just saw that you used .NOAK, I usually use .SHOWN. Is there any difference?

NAOK give code, SHOWN the sentence showed to user.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form