Welcome, Guest
Username: Password: Remember me

TOPIC: Dinamic array question

Dinamic array question 1 year 10 months ago #87735

  • Serafim
  • Serafim's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 114
  • Thank you received: 2
  • Karma: 2
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?
The administrator has disabled public write access.

Re: Dinamic array question 1 year 10 months ago #87748

  • DenisChenu
  • DenisChenu's Avatar
  • NOW ONLINE
  • Moderator Lime
  • Posts: 6317
  • Thank you received: 810
  • Karma: 242
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.
Last Edit: 1 year 10 months ago by DenisChenu.
The administrator has disabled public write access.

Re: Dinamic array question 1 year 10 months ago #87752

  • Serafim
  • Serafim's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 114
  • Thank you received: 2
  • Karma: 2
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 ( ) | ( )
The administrator has disabled public write access.

Re: Dinamic array question 1 year 10 months ago #87754

  • DenisChenu
  • DenisChenu's Avatar
  • NOW ONLINE
  • Moderator Lime
  • Posts: 6317
  • Thank you received: 810
  • Karma: 242
Multiple choice with comment ?

OR array_filter a multi numeric question type.
The administrator has disabled public write access.
The following user(s) said Thank You: Serafim

Re: Dinamic array question 1 year 10 months ago #87755

  • Serafim
  • Serafim's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 114
  • Thank you received: 2
  • Karma: 2
Multiple choice + numeric (chose from 1 to 5).

Is that even possible in the same question?
The administrator has disabled public write access.

Re: Dinamic array question 1 year 10 months ago #87778

  • DenisChenu
  • DenisChenu's Avatar
  • NOW ONLINE
  • Moderator Lime
  • Posts: 6317
  • Thank you received: 810
  • Karma: 242
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 )
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.154 seconds
Donation Image