- Posts: 4
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Validation based on equation
- andreafc
- Topic Author
- Offline
- New Member
Less
More
8 years 1 month ago - 8 years 1 month ago #133089
by andreafc
Validation based on equation was created by andreafc
I have two multiple choice questions Q1 and Q2.
For each of them I have more than 20 checkboxes.
Each checkbox of Q1 has a score of 3 (in my mind) and every checkbox of Q2 has a score of 6.
I need the final score to be exactly 51 (sum of 3*number of checks in Q1 + 6*number of checks in Q2). So I set up an equation question with the expression:
Would you guide me in the process of setting a condition such that if the score of equation is not exactly 51 the survey will not proceed?
I tried read forums and the manual, but still is not clear to me how to do.
I'm new to LimeSurvey so I will really appreciate your help!
Thanks a lot!
For each of them I have more than 20 checkboxes.
Each checkbox of Q1 has a score of 3 (in my mind) and every checkbox of Q2 has a score of 6.
I need the final score to be exactly 51 (sum of 3*number of checks in Q1 + 6*number of checks in Q2). So I set up an equation question with the expression:
Would you guide me in the process of setting a condition such that if the score of equation is not exactly 51 the survey will not proceed?
I tried read forums and the manual, but still is not clear to me how to do.
I'm new to LimeSurvey so I will really appreciate your help!
Thanks a lot!
Last edit: 8 years 1 month ago by andreafc.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
8 years 1 month ago #133100
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 Validation based on equation
Assuming question codes "Q1" and Q2" and both questions are on the same screen, something like this in the Question validation equation for both questions:
And, this for the Question validation tip:
If the questions are on separate pages, place those in Q2 only.
Sample survey attached:
And, this for the Question validation tip:
If the questions are on separate pages, place those in Q2 only.
Sample survey attached:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
The topic has been locked.
- andreafc
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
8 years 1 month ago - 8 years 1 month ago #133128
by andreafc
Replied by andreafc on topic Validation based on equation
Thanks a lot!
It works if I test the survey you sent, but it doesn't if I put it on my survey...
The prompt and the numbers selected are shown correctly. However, with the correct score I cannot proceed...
Can you help me figure out why?
Thanks again
It works if I test the survey you sent, but it doesn't if I put it on my survey...
The prompt and the numbers selected are shown correctly. However, with the correct score I cannot proceed...
Can you help me figure out why?
Thanks again
Attachments:
Last edit: 8 years 1 month ago by andreafc.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
8 years 1 month ago #133158
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 Validation based on equation
You have relevance on those questions which may mess things up but try adding .NAOK:
And:
And:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- andreafc
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
8 years 1 month ago - 8 years 1 month ago #133159
by andreafc
Replied by andreafc on topic Validation based on equation
Thanks. This doesn't change things, but thanks to your answer I noticed that the relevance equation got automatically transformed into something strange.
This was the relevance equation I originally set up:
Then for some question it was automatically changed into:
Having fixed that, now everything works!
I don't know if this is the place, but perhaps the automatic change is a bug we can signal.
This was the relevance equation I originally set up:
Code:
((BorsaINPS.NAOK != "1") and (GiaSottomesso.NAOK == "N") and (Dottorandi.NAOK == "N") and (SoloOnline.NAOK == "N"))
Code:
((565358X8X136.NAOK != "1") and (565358X8X138.NAOK == "N") and (565358X8X139.NAOK == "N") and (565358X8X140.NAOK == "N"))
Having fixed that, now everything works!
I don't know if this is the place, but perhaps the automatic change is a bug we can signal.
Last edit: 8 years 1 month ago by andreafc.
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5033
- Thank you received: 1257
8 years 1 month ago #133197
by jelo
manual.limesurvey.org/SGQA_identifier
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Validation based on equation
The strange something is the SQGA identifier.andreafc wrote: noticed that the relevance equation got automatically transformed into something strange.
manual.limesurvey.org/SGQA_identifier
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.