Dynamic Question Logics

More
4 months 3 weeks ago #170397 by urbana
urbana created the topic: Dynamic Question Logics
Hi I have a question type Array (Numbers)
My problem:
- I don't know how many answers are shown
(I use the filter option)
- I don't know how many answers the user has to give

Example:
- I show him in a multiple choise question 40 answers
- he chooses X items
- I only show in the array those X items
BUT
if X is >= 5 then the should demand min 5 and max 5 answers and show numbers from 1 to 5
if X is < 5 there are other options.

My question, can I change the logic of the question during runtime via JS or are there possiblities to add conditions in the logic expressions?

Please Log in or Create an account to join the conversation.

More
4 months 3 weeks ago - 4 months 3 weeks ago #170402 by urbana
urbana replied the topic: Dynamic Question Logics
I played around and tried to use expressions in the field maximum
So minimum is always one but maximum should be that logic:
if(count(that.effectYes.NAOK)>=5,5,count(that.effectYes.NAOK))

But all I get in the dropdowns is always 1 and 0

And in the overview of the questions, the logic expression looks like that - what looks to me like an error:
(check out the attachement)

I also tried a sample if:
if(5>6,5,3)

result, again 1 and 0
Attachments:
Last Edit: 4 months 3 weeks ago by urbana.

Please Log in or Create an account to join the conversation.

More
4 months 3 weeks ago #170417 by urbana
urbana replied the topic: Dynamic Question Logics
Anyone an idea? It's really important

Please Log in or Create an account to join the conversation.

More
4 months 3 weeks ago #170433 by tpartner
tpartner replied the topic: Dynamic Question Logics
Expressions do work in the min/max answers fields for me - see attached survey.







File Attachment:

File Name: limesurvey...6-27.lss
File Size:28 KB

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
The following user(s) said Thank You: DenisChenu

Please Log in or Create an account to join the conversation.

More
4 months 3 weeks ago #170434 by urbana
urbana replied the topic: Dynamic Question Logics
Hi I good to know - this I also what I need but I need maximum number not answer.
As you know in array(number) I have dropdowns from min to max and I want to set the max.
And that doesn't work

Please Log in or Create an account to join the conversation.

More
4 months 3 weeks ago #170436 by urbana
urbana replied the topic: Dynamic Question Logics
So here is your survey back but I changed the type to Array(number) and added the if function in the maximum field.
Attachments:

Please Log in or Create an account to join the conversation.

More
4 months 3 weeks ago #170437 by tpartner
tpartner replied the topic: Dynamic Question Logics
Sorry, I misunderstood the requirements. In that case, I think you will need to remove the drop-down options with JavaScript.

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

Please Log in or Create an account to join the conversation.

More
4 months 3 weeks ago #170439 by urbana
urbana replied the topic: Dynamic Question Logics
OK thx anyway!

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!