Can i show a random answer of a previous question in the text of other question?

Mehr
1 Woche 5 Tage her #181751 von FreshLemonUser
COM_KUNENA_MESSAGE_CREATED_NEW
Hi again, thats me... Jejeje

Can i show a random answer of a previous question in the text of other question?

i have this:

Q6Q2. When thinking about your experience with each of the following companies, what are the chances that you will recommend each to a colleague on a scale of 0-10? (Array, 5 subquestions)

Then i Have :

Q6Q2B. In the previous question, you gave a rating of {Q6Q2_SQ001.shown} and  to this company you gave a rating of: [ i have to put in here a ramdomly option with answers of 0-3 or 7-10 OF Q6Q2 different from Q6Q2_SQ001 ] can you explain this?

How can i do this: i have to put in here a ramdomly option with answers of 0-3 or 7-10 OF Q6Q2 different from Q6Q2_SQ001.

I´ve tried this, but i know that i have to many errors and i have to do more things:


if((Q6Q2_SQ002.NAOK <= 0 or Q6Q2_SQ002.NAOK >= 7) or
(Q6Q2_SQ003.NAOK <= 0 or Q6Q2_SQ003.NAOK >= 7) or
(Q6Q2_SQ004.NAOK <= 0 or Q6Q2_SQ004.NAOK >= 7),
'I have show any of this Q6Q2')

Please point me on the rigth direction.


i´ll attached some images and a LSG file.


Thanks in advanced.
Anhang:

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

LimeSurvey Partners
Mehr
1 Woche 5 Tage her #181757 von Joffm
COM_KUNENA_MESSAGE_REPLIED_NEW
Hi,
yes you can.

My solution is to use two hidden equations.
At first I changed te answer option codes to numerical codes from 0-10.

In the first equation "eq1" I join

{join(if((Q6Q2_SQ002.NAOK<4 OR Q6Q2_SQ002.NAOK>6),"2",""),if((Q6Q2_SQ003.NAOK<4 OR Q6Q2_SQ003.NAOK>6),"3",""),if((Q6Q2_SQ004.NAOK<4 OR Q6Q2_SQ004.NAOK>6),"4",""),if((Q6Q2_SQ005.NAOK<4 OR Q6Q2_SQ005.NAOK>6),"5",""))}

So, if the subquestion matches the requirement a letter is joined.
Example. If companies A and C are rated >7 the string "eq1" is "24"

In the second equation "eq2" I randomly select one of these characters
{substr(eq1,rand(0,strlen(eq1)-1),1)}

Now you have one specific character and are able to display:

In the previous question, you gave a rating of {Q6Q2_SQ001.shown} to company "XXX"

and a rating of {if(eq2==2,Q6Q2_SQ002.NAOK,if(eq2==3,Q6Q2_SQ003.NAOK,if(eq2==4,Q6Q2_SQ004.NAOK,Q6Q2_SQ005.NAOK)))} to company "{if(eq2==2,Q6Q2_SQ002.question,if(eq2==3,Q6Q2_SQ003.question,if(eq2==4,Q6Q2_SQ004.question,Q6Q2_SQ005.question)))}"

Dateianhang:

Dateiname: limesurvey...7817.lss
Dateigröße:23 KB


You have to add the check if none of the companies are in the "good" range.

Best regards
Joffm





Volunteers are not paid.
Not because they are worthless, but because they are priceless
Anhang:
Folgende Benutzer bedankten sich: FreshLemonUser

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
1 Woche 4 Tage her - 1 Woche 4 Tage her #181765 von FreshLemonUser
COM_KUNENA_MESSAGE_REPLIED_NEW
Dear Joffm

Thanks for your help, that was exactly what i needed, you are my hero.

i hope this can be used for the community

Best regards.

A Fresh Lemon User
Last edit: 1 Woche 4 Tage her by FreshLemonUser.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey
captcha