--- loncom/homework/optionresponse.pm 2004/12/04 00:41:26 1.122 +++ loncom/homework/optionresponse.pm 2005/01/31 22:00:40 1.124 @@ -1,7 +1,7 @@ # LearningOnline Network with CAPA # option list style responses # -# $Id: optionresponse.pm,v 1.122 2004/12/04 00:41:26 albertel Exp $ +# $Id: optionresponse.pm,v 1.124 2005/01/31 22:00:40 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -182,7 +182,7 @@ sub end_foilgroup { my $part_id="$Apache::inputtags::part.$Apache::inputtags::response[-1]"; push (@{ $Apache::lonhomework::analyze{"$part_id.options"} },@opt); } elsif ( $target eq 'grade') { - if ( defined $ENV{'form.submitted'}) { + if ( &Apache::response::submitted()) { my @whichopt = &whichfoils($max,$randomize); my $temp=1;my $name; my %responsehash; @@ -629,7 +629,10 @@ sub end_foil { if ($value ne 'unused') { my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval); &Apache::lonxml::debug("Got a name of :$name:"); - if (!$name) { $name=$Apache::lonxml::curdepth; } + if (!$name) { + &Apache::lonxml::error("Foils without names exist. This can cause problems to malfunction."); + $name=$Apache::lonxml::curdepth; + } &Apache::lonxml::debug("Using a name of :$name:"); if (defined($Apache::response::foilnames{$name})) { &Apache::lonxml::error(&mt("Foil name [_1] appears more than once. Foil names need to be unique.",$name));