--- loncom/interface/loncommon.pm 2001/07/26 16:00:24 1.3 +++ loncom/interface/loncommon.pm 2001/10/26 17:09:04 1.7 @@ -23,22 +23,34 @@ sub get_previous_attempt { for ($version=1;$version<=$returnhash{'version'};$version++) { map { $lasthash{$_}=$returnhash{$version.':'.$_}; - } split(/\:/,$returnhash{$version.':keys'}); + } sort(split(/\:/,$returnhash{$version.':keys'})); } $prevattempts=''; map { $prevattempts.=''; - } keys %lasthash; + } sort(keys %lasthash); for ($version=1;$version<=$returnhash{'version'};$version++) { $prevattempts.=''; map { - $prevattempts.=''; - } keys %lasthash; + my $value; + if ($_ =~ /timestamp/) { + $value=scalar(localtime($returnhash{$version.':'.$_})); + } else { + $value=$returnhash{$version.':'.$_}; + } + $prevattempts.=''; + } sort(keys %lasthash); } $prevattempts.=''; map { - $prevattempts.=''; - } keys %lasthash; + my $value; + if ($_ =~ /timestamp/) { + $value=scalar(localtime($lasthash{$_})); + } else { + $value=$lasthash{$_}; + } + $prevattempts.=''; + } sort(keys %lasthash); $prevattempts.='
History'.$_.'
Attempt '.$version.''.$returnhash{$version.':'.$_}.''.$value.'
Current'.$lasthash{$_}.''.$value.'
'; } else { $prevattempts='Nothing submitted - no attempts.'; @@ -48,5 +60,23 @@ sub get_previous_attempt { } } +sub get_unprocessed_cgi { + my ($query)= @_; + map { + my ($name, $value) = split(/=/,$_); + $value =~ tr/+/ /; + $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; + if (!defined($ENV{'form.'.$name})) { $ENV{'form.'.$name}=$value; } + } (split(/&/,$query)); +} + +sub cacheheader { + my $date=localtime; + my $output .=' + + '; + return $output; +} + 1; __END__;