Have an idea?

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

Check for Straightlining behavior in CBC Tasks

Hello,

The following script checks for straightliners in CBC Tasks. For example, if a respondent always selects the first choice set in all of the ten tasks, they will be eliminated from the survey.

Now I want to check for straightlining behavior for 9 tasks. That means that a respondent should be eliminated from the survey if he selects the same choice set already in nine choice tasks.

Is there a possibility to adjust the following code for this feature?

<input type="hidden" name="SetStraightlinerCBC_Dummy" id="SetStraightlinerCBC_Dummy" value="[% Begin Unverified Perl
# Parameters
my $exer = 'CBCTest';
my $tasks = 10;

# Run
my $resp = GETVALUE($exer . '_Random1');
for (my $i = 2; $i <= $tasks; $i++) {
    if (GETVALUE($exer . '_Random' . $i) != $resp) {
        return 0;
    }
}
return 1;
End Unverified %]"/>


I am looking forward for you help!
asked Aug 1 by ulricin (140 points)

1 Answer

0 votes
Hi Ingrid,

Looking at the code I think you just need to update $mytasks  = 10, to $mytasks = 9

Dean
answered Aug 1 by Dean Tindall Bronze Sawtooth Software, Inc. (1,325 points)
...