Welcome to the LimeSurvey Community Forum

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

Changing text

  • fumo18
  • fumo18's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 4 months ago #177235 by fumo18
Changing text was created by fumo18
Hello everyone,

I am a beginner in desperate need of help! :(

I have a single choice question (menu dropdown) ("A1") that asks respondents to choose the party they vote.


In next question i want to display the party, but i need to change the text.

"Let me show an example:
A1) Which party do you vote?
-Party A
-Party B
-Party C

A2:
You said you vote for a left-wing party...."


Only I can do is to show the answer ("You said you vote for Party A"), how I can change the answer with another text?

Thanks a lot
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago - 5 years 4 months ago #177239 by holch
Replied by holch on topic Changing text
You can use if within expression manager.

Assuming that Party A is left-wing and B and C are right wing, you could write something like this (assuming that "Party A" has the answer code 1:
Code:
You said you will vote for a {if(A1==1, "left-wing", "right-wing")} Party.

This is not tested and will obviously have to be adapted to your question and answer codes.
What is does is to check if Party A has been chosen and if this is the case it writes "left-wing", if not it writes "right-wing". This is a very simple example and you can adapt it accordingly to your example, depending on which parties are considered left-wing or right-wing or center or whatever in your example.

Should you have many different parties I would rather use a hidden equation question check the answer chosen in question A1 there and transform it into left-wing, right-wing, etc. in this equation question and then just call the content of this equation question within the text of the next question.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Last edit: 5 years 4 months ago by holch.
The following user(s) said Thank You: fumo18
The topic has been locked.
  • fumo18
  • fumo18's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 4 months ago #177247 by fumo18
Replied by fumo18 on topic Changing text
thanks for your answer, but my example was too general and the solution doesn't fit with my problem, at least i've learned something that will be usefull.
But i have 19 parties i need 19 conditions, it's beacause in my language (italian) we have different definite article.
So i need 19 outcome for 19 parties.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago #177248 by holch
Replied by holch on topic Changing text
This is why I said that for more complicated aspects you can create a equation type question and write a more complicated equation. Here an example that you most probably can adapt easily. You can use nested ifs or you can use separated ifs (not tested, you will play around with this and see if it works 100%.
Code:
{if(A1==1 OR 5 OR 15, "left-wing", if(A1==2 OR 3 OR 13, "right-wing", "not defined"))}
or
Code:
{if(A1==1 OR 5 OR 15, "left-wing", "")}
{if(A1==2 OR 3 OR 13, "right-wing", "")}
{if(A1==4 OR 6 OR 7 OR 8 OR 9 OR 10 OR 11, "center", "")}

Let's assume this equation question is called "spectrum", you can call the result of this equation which would be either "right-wing", "left-wing" or "center" via {spectrum}

With so many different parties I would actually have each group (e.g. left wing) with consecutive numbers, because it makes your formula easier.

Let's assume the parties with answer code 1-5 are left wing, the parties 6-15 are right wing and the parties 16-19 are center. Then you could just write something like this:
Code:
{if(A1 <= 5, "left wing", if(A1 <= 15, "right wing", "center))}

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago #177250 by holch
Replied by holch on topic Changing text
I am not sure how the articles play into this. Party should always have the same gender, right? Thus it is always the same article, isn't it?

And the definition if a party is right wing, left wing or whatever is made based on the answer code and not on the name of the party. And answer codes do not have articles.

But why not giving us the actual example? We don't have a crystal ball to guess what you are trying to do. ;-)

Before we are losing more time guessing around and giving solutions to something that is different to what you actually need, just give us an example, ideally the two questions in an LSS file. With this we probably can understand what you are trying to do, even if our Italian isn't that good.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • fumo18
  • fumo18's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 4 months ago #177262 by fumo18
Replied by fumo18 on topic Changing text
here the file, hope it wiil be understandable. thanks for your time
The topic has been locked.
More
5 years 4 months ago - 5 years 4 months ago #177264 by jelo
Replied by jelo on topic Changing text
You need to learn a bit about Expression Manager (soon be called ExpressionScript).

You're looking for "piping" answers into other questions.
manual.limesurvey.org/Expression_Manager...e#Tailoring.2FPiping

##

Update: Thread moved. So I have looked at your attached survey. Where is the issue? Why not add the other IFs?

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Last edit: 5 years 4 months ago by jelo.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago #177265 by holch
Replied by holch on topic Changing text
Well, given your example, you'll have to write an expression for each party that you have in the first question. You could also go through a hidden question with the Party and the article written down that is filled via an expression and then you read just this respective question that has already the party with the article to it, but I guess this might confuse you even more. As your list of Parties is "only" 28, you only have to create 28 of these expressions. Shouldn't take you very long.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago #177266 by holch
Replied by holch on topic Changing text

(you only have "of the")


You assume that we are English natives, which Jelo and I are not. ;-)

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago - 5 years 4 months ago #177271 by DenisChenu
Replied by DenisChenu on topic Changing text
Alternative solution #1 : use a second hidden one choice question + equation question (see lss attached), equation set the same value for your return question and original question, you show final value with {A1return.shown}

Alternative solution #2 : you use assessment, for example if you have 3 option, each A1 choice have 1, 2 or 3 for value. And you make test on A1. Warning 3.X version seems to have an bug here (maybe only php7.2), but it work on 2.73+PHP5.6

Denis
[strike]PS : if someone can test lss for second solution with a PHP lesser than PHP7.2[/strike]OK, tested on 5.6 seems OK.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 5 years 4 months ago by DenisChenu.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose