# The LearningOnline Network with CAPA
# various response type definitons response definition
package Apache::response;
use strict;
sub BEGIN {
&Apache::lonxml::register('Apache::response',('responseparam','caparesponse'));
}
sub start_caparesponse {
require Apache::caparesponse;
import Apache::caparesponse;
my ($target,$token,$parstack,$parser,$safeeval,$style)=@_;
# print "\n<br>\nsimple caparesponse\n";
Apache::caparesponse::start_caparesponse($target,$token,$parstack,$parser,$safeeval,$style);;
return "";
}
sub start_responseparam {
my ($target,$token,$parstack,$parser,$safeeval)=@_;
my $args='';
if ( $#$parstack > -1 ) { $args=$$parstack[$#$parstack]; }
my $default = &Apache::run::run("{$args;".'return $default}',$safeeval);
my $name = &Apache::run::run("{$args;".'return $name}',$safeeval);
&Apache::lonxml::debug("looking for resource.$Apache::inputtags::part['-1'].$name");
my $value = &Apache::lonnet::EXT("resource.$Apache::inputtags::part['-1'].$name");
&Apache::lonxml::debug("$name has value :$value: and default :$default:");
if (!$value) {
$Apache::inputtags::params{$name}=$default;
} else {
$Apache::inputtags::params{$name}=$value;
}
return '';
}
sub end_responseparam {
}
1;
__END__
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>