Welcome to the LimeSurvey Community Forum

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

How do I Validate Answers

  • pennywaltz
  • pennywaltz's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
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.
Last edit: 8 years 3 months ago by pennywaltz.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 3 months ago #129403 by DenisChenu
Replied by DenisChenu on topic How do I Validate Answers

pennywaltz wrote: I am unsure if it matters, but age (both questions) are being recorded using a drop down box.

We don't have validation for drop down.

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
  • pennywaltz's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
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
Last edit: 8 years 3 months ago by pennywaltz.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 3 months ago #129423 by DenisChenu
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

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.

Lime-years ahead

Online-surveys for every purse and purpose