Have an idea?

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

CBC - Skip logic - None option

Hi all,

I have a CBC design with 3 concepts per task plus a none option.
I am trying now to add a question with a skip logic, so that a respondent answering the CBC questions > 3 times with "None" he/she will get an additional question after the CBC exercise.

Any idea what to write exactly in the "logic" field to achieve this?

Thanks!
asked May 3 by anonymous

1 Answer

0 votes
Try out this skip logic:

Begin Unverified Perl
# Parameters
my $exercise = 'cbc';
my $randomTasks = 10;
my $fixedTasks = 0;
my $noneConcept = 4;

# Run
my $count = 0;
for (my $i = 1; $i <= $randomTasks; $i++) {
    if (GETVALUE($exercise . '_Random' . $i) == $noneConcept) {
        $count++;
    }
}
for (my $i = 1; $i <= $fixedTasks; $i++) {
    if (GETVALUE($exercise . '_Fixed' . $i) == $noneConcept) {
        $count++;
    }
}
return $count > 3;
End Unverified


Line 3 should be updated with the name of your exercise.  Lines 4 and 5 should be updated with the number of random and fixed tasks in the exercise.
answered 6 days ago by Zachary Platinum Sawtooth Software, Inc. (171,950 points)
Thank you very much!
If I check the code there is an error "Perl must have content and/or white space ...". Am I doing anything wrong?
Did you perhaps paste the code directly into the single-line skip settings box?  You may need to click the pencil icon before you can paste multiple lines of logic.
yes thats what I did but still getting the error message...
Could you share your .ssi with our support team?  A member on our team may be able to clear up this confusion more quickly if they can see what's happening directly.
okay great thanks
...