- Posts: 13146
- Thank you received: 2423
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Validating an Array (Texts)
- DenisChenu
-
- Offline
- LimeSurvey Community Team
-
Less
More
9 years 5 months ago #103004
by DenisChenu
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.
Replied by DenisChenu on topic Validating an Array (Texts)
I think :
sum(self) sum up all relevant option.
If you use array_filter it can work ?
No ?
Denis
PS: maybe it's better to do a new topic, and better explain. Because since one year there are a lot of change.
sum(self) sum up all relevant option.
If you use array_filter it can work ?
No ?
Denis
PS: maybe it's better to do a new topic, and better explain. Because since one year there are a lot of change.
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.
9 years 5 months ago #103015
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Validating an Array (Texts)
Dede1989, what question types are you using?
Can you attach a small sample survey?
Can you attach a small sample survey?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
9 years 5 months ago #103022
by Dede1989
Replied by Dede1989 on topic Validating an Array (Texts)
For my first question i'm using a multiple choice array. My second question, which uses the filter, is an array (numbers). My question validation for question 2 is "sum(self)==100". Maybe I can set all invisible options to a default value '0' ?
The topic has been locked.
9 years 5 months ago #103025
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Validating an Array (Texts)
Can you attach a small sample survey?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
9 years 5 months ago - 9 years 5 months ago #103068
by TMSWhite
If you depend upon LimeSurvey or the support team, please give generously to our 2012 fundraiser .
Replied by TMSWhite on topic Validating an Array (Texts)
A working example is attached.
In this case, you use:
The reason this works is that sum(x,y,z) will only sum the visible values if you use the .NAOK suffix on each of x, y, and z (which is what self.sq_A.NAOK does). Without the .NAOK suffix, the sum will always be zero if any rows are invisible.
Here is a screen-shot:
In this case, you use:
Code:
sum(self.sq_A.NAOK)
The reason this works is that sum(x,y,z) will only sum the visible values if you use the .NAOK suffix on each of x, y, and z (which is what self.sq_A.NAOK does). Without the .NAOK suffix, the sum will always be zero if any rows are invisible.
Here is a screen-shot:
If you depend upon LimeSurvey or the support team, please give generously to our 2012 fundraiser .
- Expression Manager (EM):
Documentation
|
Sample Surveys
|
How Tos
|
Show Logic File
|
Upgrading to 1.92+ - Excel Style for Survey Structure Import/Export
Attachments:
Last edit: 9 years 5 months ago by TMSWhite.
The following user(s) said Thank You: DenisChenu, Dede1989
The topic has been locked.