Define a variable counting number times an Option chosen in CBC

I want to include some skip logic based on whether people choose Option 1 in all of the N CBC sets they face.

This is a similar to this past question/answer:
https://sawtoothsoftware.com/forum/5420/how-to-find-out-how-often-none-was-chosen-in-cbc?show=5420#q5420

which suggested code of the form:


<input name="skip_r" id="skip_r" type="hidden" value="[% Begin Unverified Perl
my $a=0;
if(VALUE('dcepure_Random1')==1)
{
$a=$a+1;
}
if(VALUE('dcepure_Random2')==1)
{
$a=$a+1;
}
if(VALUE('dcepure_Random3')==1)
{
$a=$a+1;
}
End Unverified %]">


I guess I need to assign the value of 'a' to a variable (counter), which can then be used in a skip logic statement:
ie If counter=N, skip to the 'why always option 1' debrief question.

My attempts to do that have failed.

Any advice would be welcomed.

thanks
Dan

Resolved
2 replies