--- loncom/homework/optionresponse.pm 2002/12/02 17:06:08 1.65 +++ 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.65 2002/12/02 17:06:08 albertel 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; @@ -413,6 +416,7 @@ sub displayfoils { } if ($Apache::lonhomework::type eq 'exam') { $result.=&bubbles(\@alphabet,\@opt); + $result.='\vskip 2 mm '; } $displayoptionintex=1; } else { @@ -433,6 +437,7 @@ sub displayfoils { } if ($Apache::lonhomework::type eq 'exam') { $result.=&bubbles(\@alphabet,\@opt); + $result.='\vskip 2 mm '; } } } @@ -457,6 +462,7 @@ sub optionlist_correction { $texoptionlist =~ s/>/\$>\$/g; $texoptionlist =~ s/\$$1\$<\/m>/g; return $texoptionlist; }