version 1.2, 2000/09/19 18:04:47
|
version 1.6, 2000/11/24 21:49:08
|
Line 1
|
Line 1
|
# The LearningOnline Network with CAPA |
# The LearningOnline Network with CAPA |
# various response type definitons response definition |
# various response type definitons response definition |
|
|
|
# 11/23,11/24 Gerd Kortemeyer |
|
|
package Apache::response; |
package Apache::response; |
use strict; |
use strict; |
|
|
sub BEGIN { |
sub BEGIN { |
&Apache::lonxml::register('Apache::response',('caparesponse')); |
&Apache::lonxml::register('Apache::response',('responseparam','caparesponse')); |
} |
} |
|
|
sub start_caparesponse { |
sub start_caparesponse { |
Line 17 sub start_caparesponse {
|
Line 19 sub start_caparesponse {
|
return ""; |
return ""; |
} |
} |
|
|
|
sub start_responseparam { |
|
my ($target,$token,$parstack,$parser,$safeeval)=@_; |
|
if ($target ne 'meta') { |
|
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 ''; |
|
} else { |
|
my $tag='parameter_'.$Apache::inputtags::part['-1'].'_'. |
|
$token->[2]->{'name'}; |
|
my $display=''; |
|
if ($token->[2]->{'description'}) { |
|
$display=' display="'.$token->[2]->{'description'}.'"'; |
|
} |
|
return "\n<".$tag.$display.'>'.$token->[2]->{'type'}.':'. |
|
$token->[2]->{'default'}.'</'.$tag.'>'; |
|
} |
|
} |
|
|
|
sub end_responseparam { |
|
} |
|
|
1; |
1; |
__END__ |
__END__ |
|
|