Bienvenue, Invité
Nom d'utilisateur : Mot de passe : Se souvenir de moi

SUJET : Choosing correct question codes for arrays in expression manager

Choosing correct question codes for arrays in expression manager il y a 1 an 4 jours #98473

  • pedro1
  • Portrait de pedro1
I'm having difficulty choosing the correct question code for a response in an array and I was hoping someone might be able to help me figure it out.

I'd like to display conditional text in the end message (using Expression Manager) for respondents that select 5 out of a 1-5 rating scale for all three questions that are set up as arrays.

{if(THISPARTINEEDHELPWITH,"We are glad we could help ...","We are sorry that you are not ...")}

I have attached a screenshot of the logic file which displays the questioncodes.

Thankyou in advance.
Pièces jointes :
L'administrateur a désactivé l'accès en écriture pour le public.

Choosing correct question codes for arrays in expression manager il y a 1 an 4 jours #98474

  • JEfromCanada
  • Portrait de JEfromCanada
  • Hors ligne
  • Junior Lime
  • Messages : 39
  • Remerciements reçus 3
  • Karma: 0
Your screen shot implies that a VALUE can be attached to each answer. So, if you assign a VALUE to each subquestion (a value from 1 to 5), then you can calculate the SUM of the three question values.


Use something like {sum(info_1.value, treated_1.value, recommend_1.value)} to assign a numeric value to a question variable via a "hidden" equation. For this example, say the question variable is "evalsum"

Then, in your summary, you can say something like {if(evalsum == 15, "We are glad we could help...", "We are sorry that you are not...")}

I use version 1.92+ and you don't way which version you're on, so this might not work for you.
Dernière édition: il y a 1 an 4 jours par JEfromCanada. Raison: Misspelled a variable name in code example
L'administrateur a désactivé l'accès en écriture pour le public.

Choosing correct question codes for arrays in expression manager il y a 1 an 3 jours #98483

  • pedro1
  • Portrait de pedro1
Thanks for the prompt reply. I'm almost there. I'm using version 2.00

I've created a hidden question called "evalsum" with the equation below

{sum(info_1.value, treated_1.value, recommend_1.value)}

and I've inserted the conditional into the end message as below, pasted into source rather than html.

{if(evalsum == 15, "We are glad we could help...", "We are sorry that you are not...")}

and I'm getting only the "We are sorry that you are not..." as the message even with all responses being 5/5

I have attached a screenshot of the question logic of the hidden question, can I ask if that is the correct way to set a variable?
Pièces jointes :
L'administrateur a désactivé l'accès en écriture pour le public.

Choosing correct question codes for arrays in expression manager il y a 1 an 3 jours #98495

  • JEfromCanada
  • Portrait de JEfromCanada
  • Hors ligne
  • Junior Lime
  • Messages : 39
  • Remerciements reçus 3
  • Karma: 0
I'm not really familiar with version 2.0, since I use 1.92+.

However, your screen shot seems to show what I would call the Expression Logic, not the actual input screen for the expression (at least, not what the input screen looks like in version 1.92). Specifically, I don't see the brace brackets surrounding the "sum" formula. Without the brackets, I believe the string "sum(info_1.value, treated_1.value, recommend_1.value)" might be assigned to the evalnum variable, rather than the numeric value.

To check what's actually happening, you should create a dummy text message consisting of a debug statement that will show you the value of evalnum after the computation.

Something like "The value of evalnum is {evalnum}"

That will let you know what is going on.

Also, my instructions assumed that you were assigning values (1 through 5) to your initial question choices. In your original post, according to your screen dump, all the [values] were set to 0. This whole thing won't work properly until you assign the appropriate values to the appropriate answers.
Dernière édition: il y a 1 an 3 jours par JEfromCanada.
L'administrateur a désactivé l'accès en écriture pour le public.
Modérateurs: ITEd
Temps de génération de la page : 0.147 secondes
Donation Image