Dinamic array question

More
4 years 10 months ago #87735 by Serafim
Serafim created the topic: Dinamic array question
Hi there my question is:

I have one question that asks the user if it works with department A, B, C or D.
I want to, depending on the answer, the second question will appear with the answers of the first question, and asks from 0 to 5, how often he works with that department. Example:

-Question 1 I answer that I work with department A and C (multiple choice).
-Question 2 will appear department A and C (just like a numeric array).

I know that I can do this by adding one question for every case (A, A and B, A and C, etc), but is it possible dynamically?

Please Log in to join the conversation.

More
4 years 10 months ago - 4 years 10 months ago #87748 by DenisChenu
DenisChenu replied the topic: Dinamic array question
Hello,

Something like that:
{if(Q1_QA=="Y","dept A","")}
{if((Q1_QA=="Y" and Q1_QB=="Y"),"and dept B","")}
{if((Q1_QA!="Y" and Q1_QB=="Y"),"dept B","")}
 
{if(((Q1_QA=="Y" or Q1_QB=="Y") and Q1_QC=="Y"),"and dept C","")}
{if(((Q1_QA!="Y" and Q1_QB!="Y") and Q1_QC=="Y"),"dept C","")}

Etc (or for the first, and for the seconf line)

Denis
PS: maybe some () error.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
Last Edit: 4 years 10 months ago by DenisChenu.

Please Log in to join the conversation.

More
4 years 10 months ago #87752 by Serafim
Serafim replied the topic: Dinamic array question
Nice, it works. array_filter wasn't doing the job...

One more thing, if it is possible.

How can I put in a moltiple choice question add a numeric array? something like this:

Chose from the departments and rate them?

Department A ( ) | ( )
Department B (X) | (5)
Department C ( ) | ( )

Please Log in to join the conversation.

More
4 years 10 months ago #87754 by DenisChenu
DenisChenu replied the topic: Dinamic array question
Multiple choice with comment ?

OR array_filter a multi numeric question type.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
The following user(s) said Thank You: Serafim

Please Log in to join the conversation.

More
4 years 10 months ago #87755 by Serafim
Serafim replied the topic: Dinamic array question
Multiple choice + numeric (chose from 1 to 5).

Is that even possible in the same question?

Please Log in to join the conversation.

More
4 years 10 months ago #87778 by DenisChenu
DenisChenu replied the topic: Dinamic array question
Not exactly, 2 solution:

LS included :
Use "Multiple choice with comments" with some "Question validation equation" to control if comments are a integer beetween 1 and 5.
Do a javascript workaround to move some answer in DOM ( see : docs.limesurvey.org/Workarounds%3A+Manip...ime+using+Javascript )

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now