Create a predefined list with 18 items. Then create a constructed list that uses that predefined list as its parent. The constructed list needs this code:
Begin Unverified Perl
sub fisherYates {
my $array = shift;
my $i = @$array;
while (--$i) {
my $j = int rand($i + 1);
@$array[$i, $j] = @$array[$j, $i];
}
}
my $plist = 'list1';
my @fArr = (1, 8, 13, 18);
fisherYates(\@fArr);
foreach my $fVal (@fArr) {
if ($fVal == 1) {
ADD($plist, 1);
my @f6Arr = (2, 3, 4, 5, 6, 7);
fisherYates(\@f6Arr);
foreach my $f6Val (@f6Arr) {
ADD($plist, $f6Val);
}
}
elsif ($fVal == 8) {
my @f7Arr = (8, 9, 10, 11, 12);
fisherYates(\@f7Arr);
foreach my $f7Val (@f7Arr) {
ADD($plist, $f7Val);
}
}
elsif ($fVal == 13) {
my @f8Arr = (13, 14, 15, 16, 17);
fisherYates(\@f8Arr);
foreach my $f8Val (@f8Arr) {
ADD($plist, $f8Val);
}
}
else {
ADD($plist, 18);
}
}
End Unverified
Line 11 should be updated with the name of the predefined list.
Finally, use randomized blocks on your questions with this constructed list.