--- rat/lonpage.pm 2005/06/29 19:02:14 1.71 +++ rat/lonpage.pm 2005/06/29 19:20:10 1.72 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Page Handler # -# $Id: lonpage.pm,v 1.71 2005/06/29 19:02:14 albertel Exp $ +# $Id: lonpage.pm,v 1.72 2005/06/29 19:20:10 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -244,15 +244,25 @@ sub handler { $posthash{'latex_type'}=$env{'form.latex_type'}; $posthash{'rndseed'}=$env{'form.rndseed'}; } - if (($env{'form.'.$prefix.'submit'}) - || ($env{'form.all_submit'})) { - foreach (keys %env) { - if ($_=~/^form.$prefix/) { - my $name=$_; - $name=~s/^form.$prefix//; - $posthash{$name}=$env{$_}; - } - } + my $submitted=exists($env{'form.all_submit'}); + if (!$submitted) { + foreach my $key (keys(%env)) { + if ($key=~/^form.\Q$prefix\Esubmit_/) { + $submitted=1;last; + } + } + } + if ($submitted) { + foreach my $key (keys(%env)) { + if ($key=~/^form.\Q$prefix\E/) { + my $name=$key; + $name=~s/^form.\Q$prefix\E//; + $posthash{$name}=$env{$key}; + } + } + if (exists($env{'form.all_submit'})) { + $posthash{'all_submit'}='yes'; + } } my $output=Apache::lonnet::ssi($src,%posthash); $output=~s|//(\s*)?\s||gs;