Have an idea?

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

Random each group and whole group

Dear All,

I have 10 groups.
Group1 = 1
Group2 = 2-5
Group3 = 6-7
Group4 = 8-15
Group5 = 16-18
Group6 = 19-20
Group7 = 21
Group8 = 22-25
Group9 = 26-28
Group10 = 29-30

Each groups are Random and random all groups.

Is it possible?
asked Nov 27, 2017 by Saroeun

1 Answer

0 votes
I assume you are referring to options within a list?

Create a parent list called GroupList ...

1 Group 1
2 Group 2
3 Group 3
4 Group 4
5 Group 5
6 Group 6
7 Group 7
8 Group 8
9 Group 9
10 Group 10

Now create a constructed list called GroupRandList (this helps randomise the 10 groups) ...
ADD(GroupList)
Randomize()

Create another parent list which stores your 30 options. Call this OptionsList.

Create 10 constructed lists and name them Group1ConList to Group10ConList. Name them exactly as I have as the programming will fail otherwise. Here's a couple of examples as to what each should look like ...

Group1ConList
ADD(OptionsList,1)

Group2ConList
ADD(OptionsList,2,5)
Randomize()

Group3ConList
ADD(OptionsList,6,7)
Randomize()

and so on ...

These 10 constructed lists get their respective options and randomise them individually.

Now let's pull the 10 groups together and randomise the groups at the same time ...

Call this constructed list something like AllGroupsConList. Use this in your question where you need to display all groups.
Begin Unverified Perl
 
 ADD("Group".LISTVALUE("GroupRandList",1)."ConList");
 ADD("Group".LISTVALUE("GroupRandList",2)."ConList");
 ADD("Group".LISTVALUE("GroupRandList",3)."ConList");
 ADD("Group".LISTVALUE("GroupRandList",4)."ConList");
 ADD("Group".LISTVALUE("GroupRandList",5)."ConList");
 ADD("Group".LISTVALUE("GroupRandList",6)."ConList");
 ADD("Group".LISTVALUE("GroupRandList",7)."ConList");
 ADD("Group".LISTVALUE("GroupRandList",8)."ConList");
 ADD("Group".LISTVALUE("GroupRandList",9)."ConList");
 ADD("Group".LISTVALUE("GroupRandList",10)."ConList");
 
End Unverified 
answered Nov 27, 2017 by Paul Moon Platinum (61,555 points)
I forgot to mention if you want to display the group names as headers, check out the Question Library option ...

https://www.sawtoothsoftware.com/community-question-library/1770-subheaders
...