Welcome to the LimeSurvey Community Forum

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

An equation overreads a previous condition

  • yg_zuffetti
  • yg_zuffetti's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 11 months ago #217949 by yg_zuffetti
An equation overreads a previous condition was created by yg_zuffetti
Dear all, I am reaching out to you as I am having an issue with a subquestion. I have question from which five subquestion depend upon and they will show up only if "YES" as an answer is selected. I have added a validation equation that only integer numbers can be used as an answer and I believe this equation overrides the conditions and one of the subquestion appears even when having selected "NO" as an answer. Could someone help me out please? Thank you! 
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #217954 by tpartner
Replied by tpartner on topic An equation overreads a previous condition
LimeSurvey version?

Can you attach a small sample survey (.lss file) containing only the relevant questions.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • yg_zuffetti
  • yg_zuffetti's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 11 months ago - 3 years 11 months ago #217960 by yg_zuffetti
Replied by yg_zuffetti on topic An equation overreads a previous condition
 

File Attachment:

File Name: qid.doc
File Size:14 KB
Dear Tony,Thank you for your reply, the version is LimeSurvey Version 4.3.30 201207. I have attached the survey structure to the question - the related questions are 12 - 15 but I am not sure if I cut it right! I would like to have question 15 appear only when question 12 is "YES" but keeping the question validation equation. Thank you for your help!
Attachments:
Last edit: 3 years 11 months ago by yg_zuffetti.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #217962 by tpartner
Replied by tpartner on topic An equation overreads a previous condition
Sorry, that doesn't help. I asked for a survey export (.lss file).

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • yg_zuffetti
  • yg_zuffetti's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 11 months ago - 3 years 11 months ago #218014 by yg_zuffetti
Replied by yg_zuffetti on topic An equation overreads a previous condition
 

File Attachment:

File Name: limesurvey...7384.lsq
File Size:12 KB
 

File Attachment:

File Name: limesurvey...7398.lsq
File Size:24 KB
Dear Tpartner and everyone on the forum! I have uploaded the two questions in a test version. Test 2 should only appear when test 1 is selected and we have an equation that answers should only be integer numbers, however it appears that the equation is saying that all of our options have to be selected to have the equation validated. I hope I was able to explain this better and I remain at your disposal, thank you for your help!!
Last edit: 3 years 11 months ago by yg_zuffetti.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #218024 by holch
Replied by holch on topic An equation overreads a previous condition
Please only upload LSS files. LSQ files (like LSG files) are creating an additional work for those that are willing to respond (in their free time). For LSQ files one would have to create a survey first and then a group, etc. Also, often the geneeral settings of a survey can have an impact as well.

Also, they are language sensistive and this means that we need to guess the language right (or open them im Source mode) to make sure they can be imported into the survey and group we created.

So, take your survey, make a copy, delete everything that is not necessary and export it as a LSS file.

Help us to help you.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • yg_zuffetti
  • yg_zuffetti's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 11 months ago - 3 years 11 months ago #218030 by yg_zuffetti
Replied by yg_zuffetti on topic An equation overreads a previous condition
Thannk you Holch, I am new to this so apologies for making things a bit more complicated! Please let me know if this works - I upload my file lss.xml but lime survey won;t accept it as it wants only .lss. I've tried renaming it but still doesn't work. Any other way I can upload what you are asking please? thank you dearly
Last edit: 3 years 11 months ago by yg_zuffetti.
The topic has been locked.
  • yg_zuffetti
  • yg_zuffetti's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 11 months ago #218048 by yg_zuffetti
Replied by yg_zuffetti on topic An equation overreads a previous condition
 

File Attachment:

File Name: limesurvey...8546.lss
File Size:48 KB



Dear Holch, does this work? Its only two questions - let me knnow if I can provide you more information please. Thanks a lot!
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #218050 by tpartner
Replied by tpartner on topic An equation overreads a previous condition
You need to use ".NAOK" when some variables may be rendered irrelevant - www.limesurvey.org/manual/ExpressionScri...tation#Usage_of_NAOK .

Additionally, it is far easier to compose (and read) ExpressionScript equations if you differentiate between x and y axis sub-question codes, using "X" and "Y".

So, if you want the first four columns to be numeric-only, something like this in the question validation equation:
 
 
Code:
(is_empty(self.sq_Y01_X01.NAOK) OR is_numeric(self.sq_Y01_X01.NAOK)) 
AND 
(is_empty(self.sq_Y01_X02.NAOK) OR is_numeric(self.sq_Y01_X02.NAOK)) 
AND 
(is_empty(self.sq_Y01_X03.NAOK) OR is_numeric(self.sq_Y01_X03.NAOK)) 
AND 
(is_empty(self.sq_Y01_X04.NAOK) OR is_numeric(self.sq_Y01_X04.NAOK)) 
AND 
(is_empty(self.sq_Y02_X01.NAOK) OR is_numeric(self.sq_Y02_X01.NAOK)) 
AND 
(is_empty(self.sq_Y02_X02.NAOK) OR is_numeric(self.sq_Y02_X02.NAOK)) 
AND 
(is_empty(self.sq_Y02_X03.NAOK) OR is_numeric(self.sq_Y02_X03.NAOK)) 
AND 
(is_empty(self.sq_Y02_X04.NAOK) OR is_numeric(self.sq_Y02_X04.NAOK))
AND
(is_empty(self.sq_other_X01.NAOK) OR is_numeric(self.sq_other_X01.NAOK)) 
AND 
(is_empty(self.sq_other_X02.NAOK) OR is_numeric(self.sq_other_X02.NAOK)) 
AND 
(is_empty(self.sq_other_X03.NAOK) OR is_numeric(self.sq_other_X03.NAOK)) 
AND 
(is_empty(self.sq_other_X04.NAOK) OR is_numeric(self.sq_other_X04.NAOK))

Sample survey attached: 

File Attachment:

File Name: limesurvey...6(1).lss
File Size:49 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose