Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Piping from grid response to future question stem

I'm trying to use responses from a grid question to determine the one section of text in a future question stem.

In the grid, respondents rate 3 actions (rows) on a 1-5 likert scale of easy to hard. I gave the first two parts of the likert scale the internal label "EASY".

In the next question stem I am want one of the actions that was labeled as "EASY" to appear. The current script I am running (below) is giving an error. What is the syntax for this piping?

[% Begin Unverified Perl
if(VALUE ("NoPumpNoCGM_r1")==EASY)
{return"\Example text 1";}
else {return"\Example text 2"}
End Unverified %]
asked Jun 17 by kc17 (245 points)

1 Answer

+1 vote
If you go to your admin module, you can get the full information of the error occurring.  Without that, there's still a few things sticking out:

Unverified Perl doesn't respect internal labels.  You need to use the values saved to the database:

my $r1 = VALUE('NoPumpNoCGM_r1');
if ($r1 == 1 || $r1 == 2)

You need a semicolon after the second return statement, just like the one after the first one.

You should include a space character after the keyword "return."

Both backslash characters can be removed.  Those appeared in the earlier post as a special requirement for printing out the dollar symbol character.
answered Jun 17 by Zachary Platinum Sawtooth Software, Inc. (117,475 points)