Have an idea?

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

Is there a way to hide the attribute level based on task number?

We would like to hide the attribute brand for the first 6 tasks. Is it possible? We tried writing CBCCURRENTTASK unverified perl scripts to no avail, as from other post it seems that there is a limitation for that function. Appreciate your help on this.
related to an answer for: How to hide CBC primary attribute
asked Dec 6, 2021 by chris

1 Answer

0 votes
There are limitations on the task number functions, unfortunately, but we can still get away with using them with JavaScript to achieve this.  Try out this example:

<script>
$(document).ready(function(){
    if ([% CBCCurrentTask() %] <= 6) {
        $('.attribute_label_column > :nth-child(2), .cbc_concept:not(.none_concept) > :nth-child(2)').hide();
    }
})
</script>


There may be some analytical considerations for hiding an attribute for part of the exercise, but that is beyond my skill set to comment on.
answered Dec 6, 2021 by Zachary Platinum Sawtooth Software, Inc. (205,875 points)
...