From 9a365cc56a7e34f8bbcec87b39c06b8803c8afe9 Mon Sep 17 00:00:00 2001 From: Alex Jordan Date: Thu, 29 Feb 2024 10:48:07 -0800 Subject: [PATCH] force list context when random_subset used in dprecated macros --- macros/ui/PGchoicemacros.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/macros/ui/PGchoicemacros.pl b/macros/ui/PGchoicemacros.pl index 3f563bf8b4..6e330f40c0 100644 --- a/macros/ui/PGchoicemacros.pl +++ b/macros/ui/PGchoicemacros.pl @@ -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() @@ -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()