Welcome to the LimeSurvey Community Forum

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

Show particular answered subquestions in a following question

  • chocodon
  • chocodon's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 9 months ago - 8 years 9 months ago #121723 by chocodon
I'd like to show a subquestion of a matrix in the text of the following question if it's selected with answer "4" :

1. Q1: "Blablabla bla"
Subq1 A1 A2 A3 A4
Subq2 A1 A2 A3 A4
Subq3 A1 A2 A3 A4

2. Q2: "How often do you use Subq1?"


I tried to do that by using

Code:
How often do you use {if(Q1_Subq1.NAOK == 'A4', Q1_Subq1.question,"")}?
but it won't work that way... :( What am I doing wrong?
Last edit: 8 years 9 months ago by chocodon.
The topic has been locked.
  • holch
  • holch's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 9 months ago #121735 by holch
First of all, what is not working? What is the outcome?

Then there is one big problem with your approach. What happens if they do not answer Subq1 with A4? Then you have a question that just says "How often do you use?". That's it.

So I would do another approach: Create a question that says "How often do you use Subq1?" and then would use a relevance equation to show the question if Suq1 == A4

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
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 9 months ago - 8 years 9 months ago #121736 by holch
Played a little around with this and seems like .question can't be referenced at this particular position. You will probably have to write it out (but as limesurvey doesn't allow looping, this shouldn't be a big deal anyway to "hard code" this.

Attached a little survey where I played around with this a little.

I would go for hiding the question with relevance equation anyway, because otherwise you would have a little ugly question that doesn't make sense anyway, if the person doesn't respond this particular answer.

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

Last edit: 8 years 9 months ago by holch.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 9 months ago #121748 by DenisChenu

chocodon wrote: ...

Code:
How often do you use {if(Q1_Subq1.NAOK == 'A4', Q1_Subq1.question,"")}?
but it won't work that way... :( What am I doing wrong?

For me it's seems OK, i already use this system a lot.

Can you show a screenshot of the survey logic file ? Or send a little lss file with only this 2 question (i don't want a big survey, only this 2 question).

Denis

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.
  • holch
  • holch's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 9 months ago #121752 by holch
Hi Denis,

To me it look alright as well, so I started to play around a bit.

What I found out is that within the if loop, you can't use the .question at this particular position.

You could use just Q1_Subq1 just fine and it would show A4 when you mark A4, so the reference is correct. but when you put Q1_Subq1.question, nothing happens.

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.
  • chocodon
  • chocodon's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 9 months ago - 8 years 9 months ago #121755 by chocodon
First, thanks to all of you for your input and effort!

I tried to simplify my problem in my description yesterday. Of course I've implemented a relevance equation to avoid the partial question if nothing is selected in the question before and also an extended if-then-else-logic to show more than one .question-part if appropriate.

Here is a screenshot of the survey logic file and the .lss-file containing the 2 questions.
Hope that helps...

Thanks,
chocodon
Last edit: 8 years 9 months ago by chocodon.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose