Skip to content

Commit

Permalink
align setMessage with setCmpFlags
Browse files Browse the repository at this point in the history
  • Loading branch information
drdrew42 committed Sep 18, 2023
1 parent b40df71 commit 8bccd5c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions macros/parsers/parserMultiAnswer.pl
Original file line number Diff line number Diff line change
Expand Up @@ -461,10 +461,9 @@ sub perform_check {
# for the n-th answer blank.
#
sub setMessage {
my $self = shift;
my $i = (shift) - 1;
my $message = shift;
$self->{ans}[$i]->{ans_message} = $self->{ans}[$i]->{error_message} = $message;
my ($self, $i, $message) = @_;
die "Answer $i is not defined." unless defined($self->{ans}[ $i - 1 ]);
$self->{ans}[ $i - 1 ]{ans_message} = $self->{ans}[ $i - 1 ]{error_message} = $message;
}

######################################################################
Expand Down

0 comments on commit 8bccd5c

Please sign in to comment.