Have an idea?

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

Perl from study in LS 9.7 not working in 9.12.1

I have a study on the server generated in LS 9.7 (from 2019) that runs fine.

I just opened the LS study file and converted it to 9.12.1
When I Test the study locally I get Sawtooth Error # 132 error message when I move on from a question.

That question has in the footer the code below (which I presume is the problem). Anyone able to spot the problem?

ab1 is a  Constant Sum question on previous page.
x, y, oth1, pot1, pay1  are numeric pass-in fields.


thanks
Dan


 
 
[%SetValue(x,Value(ab1_1))%]
[%SetValue(y,Value(ab1_2))%]
[%SetValue(oth1,300)%]

[% Begin Unverified Perl

my $a= GETVALUE("ab1_1");
my $b= GETVALUE("ab1_2");
my $c= $a/100;
my $roundc = sprintf("%.2f", $c);
{
    SETVALUE(“fi1”, $roundc);
}


my $j= GETVALUE("oth1");
my $h= 0.5;
my $fundpay1= ($b+$j)*0.5;
my $allpay1= $a+($b+$j)*0.5;
{
    SETVALUE(“pot1”, $fundpay1);
    SETVALUE(“pay1”, $allpay1);
}
End Unverified %]
 
asked Oct 26, 2021 by dan r Bronze (4,025 points)

1 Answer

0 votes
 
Best answer
132 is a generic error message when something goes wrong with unverified Perl.  If you look in the admin module, you can get more information about what went wrong.

With this code, I suspect the problem is the use of stylized quotation mark characters on lines 12, 21, and 22.  If you were to replace those with normal quotation marks (like on lines 7, 8, 10, and 16), I think you'll be good to go.
answered Oct 26, 2021 by Zachary Platinum Sawtooth Software, Inc. (205,575 points)
selected Oct 26, 2021 by dan r
Thanks Zachary, the quotation mark characters  were indeed the problem.

thanks
Dan
...