Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

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

Array_filter vs. Expression Manager vs. passing through "other" 1 Jahr 1 Woche her #99295

  • holch
  • holchs Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 2637
  • Dank erhalten: 310
  • Karma: 114
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?
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Array_filter vs. Expression Manager vs. passing through "other" 1 Jahr 1 Woche her #99296

  • holch
  • holchs Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 2637
  • Dank erhalten: 310
  • Karma: 114
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.

h0ec96b7.png
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Array_filter vs. Expression Manager vs. passing through "other" 1 Jahr 5 Tage her #99310

  • trivender
  • trivenders Avatar
  • OFFLINE
  • Expert Lime
  • Beiträge: 142
  • Dank erhalten: 6
  • Karma: 6
I have a quick solution if you are comfortable in displaying both questions on separate screens.
Trivender Singh
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."
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Array_filter vs. Expression Manager vs. passing through "other" 1 Jahr 4 Tage her #99336

  • holch
  • holchs Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 2637
  • Dank erhalten: 310
  • Karma: 114
Hi Trivender. In general the questions can be shown on different screens. I would have to restructure the whole survey a little, but...
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Array_filter vs. Expression Manager vs. passing through "other" 1 Jahr 4 Tage her #99344

  • trivender
  • trivenders Avatar
  • OFFLINE
  • Expert Lime
  • Beiträge: 142
  • Dank erhalten: 6
  • Karma: 6
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.
Anhang:
Trivender Singh
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."
Letzte Änderung: 1 Jahr 4 Tage her von trivender.
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Folgende Benutzer bedankten sich: holch

Array_filter vs. Expression Manager vs. passing through "other" 1 Jahr 4 Tage her #99355

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 6276
  • Dank erhalten: 801
  • Karma: 240
Hi,

Maybe it can be great to put this in our workaround wiki :)
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Array_filter vs. Expression Manager vs. passing through "other" 1 Jahr 3 Tage her #99384

  • holch
  • holchs Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 2637
  • Dank erhalten: 310
  • Karma: 114
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?
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Array_filter vs. Expression Manager vs. passing through "other" 1 Jahr 3 Tage her #99390

  • holch
  • holchs Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 2637
  • Dank erhalten: 310
  • Karma: 114
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.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Array_filter vs. Expression Manager vs. passing through "other" 1 Jahr 3 Tage her #99399

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 6276
  • Dank erhalten: 801
  • Karma: 240
holch schrieb:
I just saw that you used .NOAK, I usually use .SHOWN. Is there any difference?
NAOK give code, SHOWN the sentence showed to user.
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.203 Sekunden
Donation Image