Skip to content

Commit

Permalink
Fix randomization of values with labels.
Browse files Browse the repository at this point in the history
  • Loading branch information
drgrice1 committed Dec 8, 2024
1 parent fd54ee4 commit 1e3d69b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions macros/parsers/parserPopUp.pl
Original file line number Diff line number Diff line change
Expand Up @@ -269,16 +269,16 @@ sub addLabelsValues {
my $self = shift;
my $choices = $self->{orderedChoices};
my $labels = [];
my $values = $self->{values};
my $n = $self->{n};
my $values = [ (undef) x $n ];

foreach my $i (0 .. $n - 1) {
if (ref($choices->[$i]) eq "HASH") {
$labels->[$i] = (keys %{ $choices->[$i] })[0];
$values->[$i] = $choices->[$i]{ $labels->[$i] };
} else {
$labels->[$i] = $choices->[$i];
$values->[$i] = $choices->[$i] unless (defined($values->[$i]) && $values->[$i] ne '');
$values->[$i] = $self->{values}[ $self->{order}[$i] ] // $choices->[$i];
}

}
Expand Down

0 comments on commit 1e3d69b

Please sign in to comment.