Have an idea?

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

Pull in Not selected from CBC

We have a Discrete Choice where we show a follow up question pulling in the item selected in that screen.  Is there a way to pull in one of the items which were NOT selected?  Our goal is to show 8 follow up screens:

Best from 2nd screen
Best from 4th screen
Best from 6th screen
Best from 8th screen

Not picked from 1st screen
Not picked from 3rd screen
Not picked from 5th screen
Not picked from 7th screen

Is this possible?  If so, how would I achieve this?  Thanks!
asked Jun 6, 2018 by Michael
What code are you already using to pull in the selected concept?
This includes some HTML to make it look OK.  But here it is.  Caviat, We are showing 3 items per screen, so we would somehow have to randomly select one of the options NOT selected in each screen for the follow ups.

<center><style type="text/css">
.tg  {border-collapse:collapse;border-spacing:0;border-color:#ccc;}
.tg td{font-family:Arial, sans-serif;font-size:18px;padding:10px 5px;overflow:hidden;word-break:normal;border-color:#ccc;color:#333;background-color:#fff;}
.tg th{font-family:Arial, sans-serif;font-size:18px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:#ccc;color:#333;background-color:#f0f0f0;}
.tg .tg-g76l{background-color:#BADCDC}
.tg .tg-hjma{background-color:#ffffff}
</style>
<table class="tg">

    <td class="tg-g76l" style="width: 505px; font-size: small;"><font size="3px">[%CBCDesignLevelText(CBC1200_Random1, GetValue(CBC1200_Random1_b), 1)%]</font></td>
  </tr>
  <tr>

    <td class="tg-g76l" style="width: 505px; font-size: small;"><font size="3px">[%CBCDesignLevelText(CBC1200_Random1, GetValue(CBC1200_Random1_b), 2)%]</font></td>
  </tr>
    <tr>
  
      <td class="tg-g76l" style="width: 505px; font-size: small;"><font size="3px">[%CBCDesignLevelText(CBC1200_Random1, GetValue(CBC1200_Random1_b), 3)%]</font></td>
  </tr>
    <tr>
  
      <td class="tg-g76l" style="width: 505px; font-size: small;"><font size="3px">[%CBCDesignLevelText(CBC1200_Random1, GetValue(CBC1200_Random1_b), 4)%]</font></td>
  </tr>
</table><p></center>

1 Answer

0 votes
Thinking outside the box here, but I'd be tempted to do this using constructed lists. You'd create a parent list for each CBC task, with three items in the list. Each item would include the code you posted in your comment, but would specifically be coded for task x concept 1, task x concept 2, and task x concept 3. To randomly display a non-selected one, create a constructed list that adds the parent list, removes the selected option, and then randomizes the list:


Parent List: ListCBCTask1

Constructed List: ListCBCTask1NC

ADD(ListCBCTask1)
REMOVE(ListCBCTask1,GetValue(CBC1200_Random1_b))
RANDOMIZE()

Then just display the ListLabel for the first item, which will be a randomly selected unchosen option.
answered Jun 6, 2018 by Aaron Hill Gold Sawtooth Software, Inc. (10,095 points)
It occurs to me that you could then use these lists to display whichever concept you wanted. Once built, you could clean up your code on the page by referring to the parent list and requesting the ListLabel for the item selected in the CBC task to get the selected concept's description, or you could use the constructed list to get an unselected concept.
...