--- loncom/homework/optionresponse.pm 2012/11/30 11:45:50 1.188 +++ loncom/homework/optionresponse.pm 2012/12/18 16:30:23 1.189 @@ -1,7 +1,7 @@ # LearningOnline Network with CAPA # option list style responses # -# $Id: optionresponse.pm,v 1.188 2012/11/30 11:45:50 foxr Exp $ +# $Id: optionresponse.pm,v 1.189 2012/12/18 16:30:23 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -499,8 +499,11 @@ sub check_for_invalid { sub displayfoils { my ($target,$max,$randomize,$TeXlayout,$checkboxvalue,$checkboxchoices, $tex_option_switch, $no_tfprompt, @opt)=@_; - if (!defined(@{ $Apache::response::foilgroup{'names'} })) {return;} - my @names = @{ $Apache::response::foilgroup{'names'} }; + my @names; + if (ref($Apache::response::foilgroup{'names'}) eq 'ARRAY') { + @names = @{ $Apache::response::foilgroup{'names'} }; + } + unless (@names > 0) { return;} my @truelist; my @falselist; my $result;