Welcome to the LimeSurvey Community Forum

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

set maximum based previous question

  • brais24
  • brais24's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
3 years 3 months ago #225787 by brais24
set maximum based previous question was created by brais24
Please help us help you and fill where relevant:
Your LimeSurvey version: 3.25
Own server or LimeSurvey hosting: Own
Survey theme/template: Fruity
==================
Hi there people, I have a question, Ive been looking for this but i dont found anything about that, ir is possible to put on a question different maximum of answer based on a previous question?

For example, I have 2 multiple choice question that have as maximum 1 response on each one (I know, multiple choice with 1 as maximum?) but doesnt matter here, lets suposse that questions is P1 and P2, now I want on P3 set the maximum response 6 if you mark a response just on P1, and leave P2 empty, and set the maximum as 3 if you mark P1 and P2.

Is that possible to do?

Thanks for the help.

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 3 months ago #225789 by tpartner
Replied by tpartner on topic set maximum based previous question
You can use ExpressionScript in the "Maximum answers" field.

Something like this:

Code:
if(count(that.P1) > 0 AND count(that.P2) == 0, 6, 3)

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

  • brais24
  • brais24's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
3 years 3 months ago #225826 by brais24
Replied by brais24 on topic set maximum based previous question
Seems like it worked, thank you!!

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose