Skip to content

Commit cc3a4cd

Browse files
committed
Fix the response group for single option radio or checkbox answers.
The new handling in the response group when a radio or checkbox answer is extended that was added in #778 is also needed when a response is initially added. This fixes issue #901.
1 parent de1a4bb commit cc3a4cd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/PGresponsegroup.pm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ sub append_response {
5454
if (not_null($response_label)) {
5555
if (not exists($self->{responses}{$response_label})) {
5656
push @{ $self->{response_order} }, $response_label;
57-
$self->{responses}{$response_label} = $response_value;
57+
$self->{responses}{$response_label} =
58+
ref($response_value) eq 'HASH'
59+
? [ map { [ $_ => $response_value->{$_} ] } keys %$response_value ]
60+
: $response_value;
5861
} else {
5962
$self->internal_debug_message(
6063
"PGresponsegroup::append_response error: there is already an answer labeled $response_label",

0 commit comments

Comments
 (0)