Skip to content

Commit

Permalink
Merge pull request openwebwork#1028 from Alex-Jordan/NchooseK
Browse files Browse the repository at this point in the history
force list context when random_subset used in dprecated macros
  • Loading branch information
drgrice1 authored Mar 13, 2024
2 parents a9d9280 + 9a365cc commit d2bead5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions macros/ui/PGchoicemacros.pl
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,9 @@ sub invert {

sub NchooseK {
my ($n, $k) = @_;
return random_subset($k, 0 .. $n - 1);
# force list context
my @return = random_subset($k, 0 .. $n - 1);
return @return;
}

=item [DEPRECATED] shuffle()
Expand All @@ -808,7 +810,9 @@ sub NchooseK {

sub shuffle {
my ($i) = @_;
return random_subset($i, 0 .. $i - 1);
# force list context
my @return = random_subset($i, 0 .. $i - 1);
return @return;
}

=item [DEPRECATED] match_questions_list()
Expand Down

0 comments on commit d2bead5

Please sign in to comment.