version 1.24, 2002/01/30 17:40:39
|
version 1.26, 2002/03/06 20:24:44
|
Line 358 sub get_student_answers {
|
Line 358 sub get_student_answers {
|
} |
} |
|
|
sub get_unprocessed_cgi { |
sub get_unprocessed_cgi { |
my ($query)= @_; |
my ($query,$possible_names)= @_; |
|
# $Apache::lonxml::debug=1; |
foreach (split(/&/,$query)) { |
foreach (split(/&/,$query)) { |
my ($name, $value) = split(/=/,$_); |
my ($name, $value) = split(/=/,$_); |
$value =~ tr/+/ /; |
$name = &Apache::lonnet::unescape($name); |
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; |
if (!defined($possible_names) || (grep {$_ eq $name} @$possible_names)) { |
if (!defined($ENV{'form.'.$name})) { $ENV{'form.'.$name}=$value; } |
$value =~ tr/+/ /; |
|
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; |
|
&Apache::lonxml::debug("Seting :$name: to :$value:"); |
|
&add_to_env('form.'.$name,$value); |
|
} |
} |
} |
} |
} |
|
|
Line 384 sub no_cache {
|
Line 389 sub no_cache {
|
$r->header_out("Pragma" => "no-cache"); |
$r->header_out("Pragma" => "no-cache"); |
#$r->header_out("Expires" => $date); |
#$r->header_out("Expires" => $date); |
} |
} |
|
|
|
sub add_to_env { |
|
my ($name,$value)=@_; |
|
if ($ENV{$name}) { |
|
if (defined(@{ $ENV{$name} })) { |
|
#already have multiple values |
|
push(@{ $ENV{$name} },$value); |
|
} else { |
|
#first time seeing multiple values, convert hash entry to an arrayref |
|
my $first=$ENV{$name}; |
|
undef($ENV{$name}); |
|
push(@{ $ENV{$name} },$first,$value); |
|
} |
|
} else { |
|
$ENV{$name}=$value; |
|
} |
|
} |
1; |
1; |
__END__; |
__END__; |
|
|
Line 488 cacheheader() : returns cache-controllin
|
Line 510 cacheheader() : returns cache-controllin
|
|
|
nocache() : specifies header code to not have cache |
nocache() : specifies header code to not have cache |
|
|
|
=item * |
|
|
|
add_to_env($name,$value) : adds $name to the %ENV hash with value |
|
$value, if $name already exists, the entry is converted to an array |
|
reference and $value is added to the array. |
|
|
=back |
=back |
|
|
=cut |
=cut |