version 1.29, 2004/02/10 17:01:20
|
version 1.30, 2004/03/08 23:23:04
|
Line 28
|
Line 28
|
package Apache::rankresponse; |
package Apache::rankresponse; |
use strict; |
use strict; |
use HTML::Entities(); |
use HTML::Entities(); |
use Apache::optionresponse; |
use Apache::optionresponse(); |
|
use Apache::lonlocal; |
|
|
BEGIN { |
BEGIN { |
&Apache::lonxml::register('Apache::rankresponse',('rankresponse')); |
&Apache::lonxml::register('Apache::rankresponse',('rankresponse')); |
Line 43 sub start_rankresponse {
|
Line 44 sub start_rankresponse {
|
push (@Apache::lonxml::namespace,'rankresponse'); |
push (@Apache::lonxml::namespace,'rankresponse'); |
my $id = &Apache::response::start_response($parstack,$safeeval); |
my $id = &Apache::response::start_response($parstack,$safeeval); |
%Apache::hint::rank=(); |
%Apache::hint::rank=(); |
|
undef(%Apache::response::foilnames); |
if ($target eq 'meta') { |
if ($target eq 'meta') { |
$result=&Apache::response::meta_package_write('rankresponse'); |
$result=&Apache::response::meta_package_write('rankresponse'); |
} elsif ($target eq 'edit' ) { |
} elsif ($target eq 'edit' ) { |
Line 77 sub end_rankresponse {
|
Line 79 sub end_rankresponse {
|
pop @Apache::lonxml::namespace; |
pop @Apache::lonxml::namespace; |
&Apache::lonxml::deregister('Apache::rankresponse', |
&Apache::lonxml::deregister('Apache::rankresponse', |
('foilgroup','foil','conceptgroup')); |
('foilgroup','foil','conceptgroup')); |
|
undef(%Apache::response::foilnames); |
return $result; |
return $result; |
} |
} |
|
|
Line 406 sub end_foil {
|
Line 409 sub end_foil {
|
my $value = &Apache::lonxml::get_param('value',$parstack,$safeeval); |
my $value = &Apache::lonxml::get_param('value',$parstack,$safeeval); |
if ($value ne 'unused') { |
if ($value ne 'unused') { |
my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval); |
my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval); |
my $location =&Apache::lonxml::get_param('location',$parstack,$safeeval); |
|
&Apache::lonxml::debug("Got a name of :$name:"); |
&Apache::lonxml::debug("Got a name of :$name:"); |
if (!$name) { $name=$Apache::lonxml::curdepth; } |
if (!$name) { $name=$Apache::lonxml::curdepth; } |
&Apache::lonxml::debug("Using a name of :$name:"); |
&Apache::lonxml::debug("Using a name of :$name:"); |
|
if (defined($Apache::response::foilnames{$name})) { |
|
&Apache::lonxml::error(&mt("Foil name <b><tt>[_1]</tt></b> appears more than once. Foil names need to be unique.",$name)); |
|
} |
|
my $location =&Apache::lonxml::get_param('location',$parstack, |
|
$safeeval); |
if ( $Apache::rankresponse::conceptgroup |
if ( $Apache::rankresponse::conceptgroup |
&& !&Apache::response::showallfoils() ) { |
&& !&Apache::response::showallfoils() ) { |
push @{ $Apache::response::conceptgroup{'names'} }, $name; |
push @{ $Apache::response::conceptgroup{'names'} }, $name; |