Skip to content

Commit 26f77df

Browse files
authored
Merge pull request #1032 from Alex-Jordan/hotfix/NchooseK
HOTFIX: force list context when random_subset used in dprecated macros
2 parents 9cefdf9 + 3fb9c0f commit 26f77df

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

macros/ui/PGchoicemacros.pl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,9 @@ sub invert {
800800

801801
sub NchooseK {
802802
my ($n, $k) = @_;
803-
return random_subset($k, 0 .. $n - 1);
803+
# force list context
804+
my @return = random_subset($k, 0 .. $n - 1);
805+
return @return;
804806
}
805807

806808
=item [DEPRECATED] shuffle()
@@ -815,7 +817,9 @@ sub NchooseK {
815817

816818
sub shuffle {
817819
my ($i) = @_;
818-
return random_subset($i, 0 .. $i - 1);
820+
# force list context
821+
my @return = random_subset($i, 0 .. $i - 1);
822+
return @return;
819823
}
820824

821825
=item [DEPRECATED] match_questions_list()

0 commit comments

Comments
 (0)