This is the constructed list instruction that you'll need for Q2 and Q3:
Begin Unverified Perl
# Parameters
my $plist = 'list1';
my $cs = 'Q1';
my $rank = 1;
# Run
my $hash = ();
for (my $i = 1; $i <= LISTLENGTH($plist); $i++) {
my $resp = GETVALUE($cs . '_' . $i);
if (!exists $hash->{$resp}) {
my @emp = ();
$hash->{$resp} = \@emp;
}
push (@{$hash->{$resp}}, $i);
}
my @sortedResps = sort {$b <=> $a} keys %{$hash};
if (scalar @sortedResps >= $rank) {
my $resp = $sortedResps[$rank - 1];
if ($resp != 0) {
foreach my $i (@{$hash->{$resp}}) {
ADD($plist, $i);
}
}
}
End Unverified
Line 3 must be updated with the name of the predefined list. Line 4 must be updated with the name of the constant sum question. Line 5 should be updated with the value of 2 for Q3.