Multiple Thank You Page/ Feedback on Survey

More
3 years 10 months ago - 3 years 10 months ago #100304 by ottawa_prof
ottawa_prof created the topic: Multiple Thank You Page/ Feedback on Survey
I am currently using version 1.92+

I am working on a survey where participants will receive feedback based on 1 of the question groups. The feedback is based on a summed score from an array type question with 22 items.
As I understand from the manual to do this I would first create a hidden item that contains the total score. I did this by creating an equation question and summing each of the items. Here is my code:

sum(IES_IES1, IES_IES2, IES_IES3, IES_IES4, IES_IES5, IES_IES6, IES_IES7, IES_IES8, IES_IES9, IES_IES10, IES_IES11, IES_IES12, IES_IES13, IES_IES14, IES_IES15, IES_IES16, IES_IES17, IES_IES18, IES_IES19, IES_IES20, IES_IES21)

Following this I would create an "if" statement in my debriefing page referring to that equation question. Here is my code for that:
{if (EQ_IES <= 11,'Your response ...'if (EQ_IES < 32,'Your response... .'if (EQ_IES >= 33,'Your response ... .')))}

I have encountered the following difficulties and do not know why:
1. My equation, which I have not yet hidden yet, is continually 0, even though the responses on the array have non-zero responses. That is my equation does not seem to be calculating the sum. The logic file for this question does not show any errors. - I HAVE FIGURED OUT PART 1 OF MY PROBLEM - I NEED TO ADD .value, PART 2 STILL DOES NOT WORK
2. My if statement does not seem to work as when I test it I see all the if statements. The logic file for this question shows an error in the final if statement, but if I remove the spaces or anything there is no difference.
Last Edit: 3 years 10 months ago by ottawa_prof. Reason: Part of problem solved.

Please Log in to join the conversation.

More
3 years 10 months ago - 3 years 10 months ago #100348 by tpartner
tpartner replied the topic: Multiple Thank You Page/ Feedback on Survey
It looks like you're missing some commas. A basic IF statement looks like this:
{if(something == something, 'Text if true', 'Text if false')}


So your nested IFs might look like this (with line-breaks for clarity):
{if (EQ_IES <= 11,
	'Your response ...', 
	if (EQ_IES < 32,
		'Your response... .',
		if (EQ_IES >= 33,
			'Your response ... .',
			'Whatever if this is false'
		)
	)
)}

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 3 years 10 months ago by tpartner.

Please Log in to join the conversation.

Did you already participate in our customer survey?

Don't miss your chance for great prices.

Please click here to participate:

Start now

Start now!

Just create your account and start using Limesurvey today.

Register now