--- loncom/homework/optionresponse.pm 2003/01/13 21:24:39 1.66 +++ loncom/homework/optionresponse.pm 2003/01/19 08:10:22 1.67 @@ -1,7 +1,7 @@ # LearningOnline Network with CAPA # option list style responses # -# $Id: optionresponse.pm,v 1.66 2003/01/13 21:24:39 sakharuk Exp $ +# $Id: optionresponse.pm,v 1.67 2003/01/19 08:10:22 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -248,6 +248,7 @@ sub whichfoils { my ($max,$randomize)=@_; $max = &getfoilcounts($max); &Apache::lonxml::debug("randomize $randomize"); + if (!defined(@{ $Apache::response::foilgroup{'names'} })) {return;} my @names = @{ $Apache::response::foilgroup{'names'} }; my @whichopt =(); my (%top,@toplist,%bottom,@bottomlist); @@ -294,6 +295,7 @@ sub whichfoils { sub displayanswers { my ($max,$randomize,@opt)=@_; + if (!defined(@{ $Apache::response::foilgroup{'names'} })) {return;} my @names = @{ $Apache::response::foilgroup{'names'} }; my @whichopt = &whichfoils($max,$randomize); my $result=&Apache::response::answer_header('optionresponse'); @@ -307,6 +309,7 @@ sub displayanswers { sub displayfoils { my ($target,$max,$randomize,@opt)=@_; + if (!defined(@{ $Apache::response::foilgroup{'names'} })) {return;} my @names = @{ $Apache::response::foilgroup{'names'} }; my @truelist; my @falselist;