Welcome to the LimeSurvey Community Forum

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

conditions for answers

  • ROSt52
  • ROSt52's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 11 months ago #183637 by ROSt52
conditions for answers was created by ROSt52
I have a 2 step age question

preferred age range: from - until (here I want the condition that "from" is smaller than "until")

maximum age range: from - until (here I want the condition that "from" is smaller or equal than "from" of preferred age range and "until" is larger or equal than "until" from preferred age range.

Where and how can I set such condition?

Thanks in advance for your helping answers!
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 11 months ago #183645 by Joffm
Replied by Joffm on topic conditions for answers
Which question types are you going to use?
Multiple numerical?
1. is_empty(Q1_SQ001) OR is_empty(Q1_SQ002) OR Q1_SQ001 lt Q1_SQ002
2. is_empty(Q2_SQ001) OR is_empty(Q2_SQ002) OR (Q2_SQ001 le that.Q1_SQ001 AND Q2_SQ002 ge that.Q1_SQ002)

Array(numbers)
1. is_empty(Q1_Y001_X001) OR is_empty(Q1_Y001_X002) OR Q1_Y001_X001 lt Q1_Y001_X002
2. is_empty(Q2_Y001_X001) OR is_empty(Q2_Y001_X002) OR (Q2_Y001_X001 le that.Q1_Y001_X001 AND Q2_Y001_X002 ge that.Q1_Y001_X002)

Better you show us your design.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: ROSt52
The topic has been locked.
  • ROSt52
  • ROSt52's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 11 months ago #183649 by ROSt52
Replied by ROSt52 on topic conditions for answers
Thanks for reply.

I will now try to work out conditions according your kind advice.

You are right I should have given a bit more information.

I use ARRAY (numbers) type of question.

A screen shot is attached.
The topic has been locked.
  • ROSt52
  • ROSt52's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 11 months ago #183690 by ROSt52
Replied by ROSt52 on topic conditions for answers
I look into the above given regular expression and tried to adjust it to my questions. However, I have to admit that I failed.

To above reply is a screenshot attached.

The question number is Q00024.

I really appreciate your help your here.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 11 months ago - 4 years 11 months ago #183691 by Joffm
Replied by Joffm on topic conditions for answers
Please send your sample as lss.

This will avoid confusion about the naming of questions and subquestions, y-scale and x-scale.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 4 years 11 months ago by Joffm.
The following user(s) said Thank You: ROSt52
The topic has been locked.
  • ROSt52
  • ROSt52's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 11 months ago #183693 by ROSt52
Replied by ROSt52 on topic conditions for answers
Did not know that I can export a single question.

Exported it as lsq file (only format available) and placed it in a zip file to match the needed format for attachments.

Thanks a lot for your ongoing help!!!
Attachments:
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 11 months ago #183694 by holch
Replied by holch on topic conditions for answers
Please always export a LSS file with only the relevant questions. While the lsq file seems a good idea, it gives the helpers in the forum a lot more work, as they need to create a survey and a group into which they can import your lsq and if the base language differs, they need to create a new one.

I understand it can be a little bit more work on your side, but at the end of the day we are all volunteers that help here for free and also have limited time.

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

The following user(s) said Thank You: ROSt52
The topic has been locked.
  • ROSt52
  • ROSt52's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 11 months ago #183699 by ROSt52
Replied by ROSt52 on topic conditions for answers
Thanks for your hint with the lss file. For sure I will do so right away. I will try to find the way to export the related question in lss format.
The topic has been locked.
  • ROSt52
  • ROSt52's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 11 months ago - 4 years 11 months ago #183700 by ROSt52
Replied by ROSt52 on topic conditions for answers
How can I export a single question in lss format?

I found the export to lsq, and the export of a group into lsg but not a single question into lss format.

Could you please give me a hint?


What I tried is to export the entire survey and edited the html file. A re-import failed because I somehow oversaw something in the html structure. The error message I got is "This is not a valid LimeSurvey survey structure XML file."
Last edit: 4 years 11 months ago by ROSt52.
The topic has been locked.
  • tammo
  • tammo's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
4 years 11 months ago #183701 by tammo
Replied by tammo on topic conditions for answers
Hi, you would do that (I would) by copying your survey to a new survey, delete every group that is not relevant and then delete every question that is not relevant in the resulting group(s). After that export the complete survey, that now has only one or some relevant questions that show the problem that you want solved.

Tammo


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The following user(s) said Thank You: DenisChenu, tpartner, ROSt52
The topic has been locked.
  • ROSt52
  • ROSt52's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 11 months ago #183707 by ROSt52
Replied by ROSt52 on topic conditions for answers
Thanks for the hint with copying an deleting!


Attached is now the survey with the single question and it is in lss format.

I made a re-import test and it worked.

Email text are strange because i needed to delete confidential information; thus don't wonder.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 11 months ago - 4 years 11 months ago #183804 by tpartner
Replied by tpartner on topic conditions for answers
It is almost impossible to use Expression Manager when you assign both the y-axis and x-axis sub-question codes SQ001, SQ002...

You should differentiate with something like this for the y-axis: Y001, Y002...

And something like this for the x-axis: X001, X002...

Having done that, your validation equation would be like this (line-breaks inserted for clarity):

Code:
self.sq_Y001_X001 < self.sq_Y001_X002
AND
self.sq_Y001_X001 >= self.sq_Y002_X001
AND
self.sq_Y001_X002 <= self.sq_Y002_X002

Here is a copy of your survey with those changes:

File Attachment:

File Name: limesurvey...2111.lss
File Size:19 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 4 years 11 months ago by tpartner.
The following user(s) said Thank You: DenisChenu, ROSt52
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose