Welcome to the LimeSurvey Community Forum

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

Differents validations for differents subquestions in a numeric multiple answer

  • helviobrito
  • helviobrito's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
8 years 1 week ago #134098 by helviobrito
Hi. Please, can someone help me with this task?

I have a multiple answer numeric question and need to validate each answer, in the same question, with different values.

Subquestion 1: must accept only numbers 0, 2, 5, 14
Subquestion 2: must accept only numbers 7, 10, 53, 140
Subquestion 3: must accept only numbers 5, 6, 22, 30

As you can see, each subquestion is to be validatated by a list of numbers with no relations between them. I tried to do this with a regex code put in the relevance field of the subquestion. Didn't worked. I tried to edit the .lss archive, introducing the tag <preg>regex</preg> after the subquestion id, and nothing. Is there ay way to do this?

Thanks in advance, guys.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 1 week ago #134103 by tpartner
There is no validation for sub-questions. I would use 3 dropdown type 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.
  • helviobrito
  • helviobrito's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
8 years 1 week ago #134109 by helviobrito
Thank you for the suggestion. But I solved the task in another way.

Since the question must be entered by typing in the numeric fields due to the particular survey operation and design, I changed the multiple input numeric subquestions to numeric questions. Then I used regex codes in the validation field of each one.

Eg.: Q1 should accept only 0, 3, 7 10 e 14. The regex /^([3|7|0]|10|14)$/ do the job and control the input.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose