- Posts: 24
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
How do I Validate Answers
- pennywaltz
- Topic Author
- Offline
- Junior Member
Less
More
8 years 3 months ago - 8 years 3 months ago #129387
by pennywaltz
How do I Validate Answers was created by pennywaltz
I am trying to figure out how to do this.
On page 1 of my survey, I asked the participant age (code:age)
On page 2, I asked at what age was the participant was diagnosed with a disasse (code:agedx).
So I want to prevent an answer where the agedx is greater than age. I started off by creating a flag (equation variable) where I set it as if(age1 < AgedxkN, 2, 1). And I created a text display code where if flag==2 then display the text (A warning saying "your age dx is greater than your age"). BUT the participant can still hit next and continue on to the survey.
So basically, if the subject is 29 year old... his diagnosed age should be less than or equal to 29. So if the subject answered 32 for example, I want to alert the subject and would not allow him to continue onto the survey until that answer is fixed.
I want the participant to be able to submit a valid answer (so flag==1), before being able to continue. How can I do this?
I am unsure if it matters, but age (both questions) are being recorded using a drop down box.
On page 1 of my survey, I asked the participant age (code:age)
On page 2, I asked at what age was the participant was diagnosed with a disasse (code:agedx).
So I want to prevent an answer where the agedx is greater than age. I started off by creating a flag (equation variable) where I set it as if(age1 < AgedxkN, 2, 1). And I created a text display code where if flag==2 then display the text (A warning saying "your age dx is greater than your age"). BUT the participant can still hit next and continue on to the survey.
So basically, if the subject is 29 year old... his diagnosed age should be less than or equal to 29. So if the subject answered 32 for example, I want to alert the subject and would not allow him to continue onto the survey until that answer is fixed.
I want the participant to be able to submit a valid answer (so flag==1), before being able to continue. How can I do this?
I am unsure if it matters, but age (both questions) are being recorded using a drop down box.
Last edit: 8 years 3 months ago by pennywaltz.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
8 years 3 months ago #129403
by DenisChenu
Better to use "numeric" question type or short text : manual.limesurvey.org/Question_type_-_Sh...8em_validation_sq.29
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 How do I Validate Answers
We don't have validation for drop down.pennywaltz wrote: I am unsure if it matters, but age (both questions) are being recorded using a drop down box.
Better to use "numeric" question type or short text : manual.limesurvey.org/Question_type_-_Sh...8em_validation_sq.29
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.
- pennywaltz
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 24
- Thank you received: 0
8 years 3 months ago - 8 years 3 months ago #129414
by pennywaltz
Replied by pennywaltz on topic How do I Validate Answers
just to understand the example you linked to me:
(this / 3) == floor(this/3)
This is basically the code right? and this goes into the validation box?
so would I type in agedx<=age in the validation box, so where the agedx must be less than or equal to age
(this / 3) == floor(this/3)
This is basically the code right? and this goes into the validation box?
so would I type in agedx<=age in the validation box, so where the agedx must be less than or equal to age
Last edit: 8 years 3 months ago by pennywaltz.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
8 years 3 months ago #129423
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 How do I Validate Answers
No,
Not in validatio box , in advanced settings part.
But with numerci question type : manual.limesurvey.org/Question_type_-_Nu...28max_num_value_n.29 use directmly max value.
Denis
Not in validatio box , in advanced settings part.
But with numerci question type : manual.limesurvey.org/Question_type_-_Nu...28max_num_value_n.29 use directmly max value.
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.