Annotation of loncom/homework/response.pm, revision 1.4
1.1 albertel 1: # The LearningOnline Network with CAPA
2: # various response type definitons response definition
3:
4: package Apache::response;
5: use strict;
6:
7: sub BEGIN {
1.3 albertel 8: &Apache::lonxml::register('Apache::response',('responseparam','caparesponse'));
1.1 albertel 9: }
10:
11: sub start_caparesponse {
12: require Apache::caparesponse;
13: import Apache::caparesponse;
14: my ($target,$token,$parstack,$parser,$safeeval,$style)=@_;
1.2 albertel 15: # print "\n<br>\nsimple caparesponse\n";
1.1 albertel 16: Apache::caparesponse::start_caparesponse($target,$token,$parstack,$parser,$safeeval,$style);;
1.2 albertel 17: return "";
1.3 albertel 18: }
19:
20: sub start_responseparam {
21: my ($target,$token,$parstack,$parser,$safeeval)=@_;
22: my $args='';
23: if ( $#$parstack > -1 ) { $args=$$parstack[$#$parstack]; }
24: my $default = &Apache::run::run("{$args;".'return $default}',$safeeval);
1.4 ! albertel 25: my $name = &Apache::run::run("{$args;".'return $name}',$safeeval);
! 26: &Apache::lonxml::debug("looking for resource.$Apache::inputtags::part['-1'].$name");
! 27: my $value = &Apache::lonnet::EXT("resource.$Apache::inputtags::part['-1'].$name");
! 28: &Apache::lonxml::debug("$name has value :$value: and default :$default:");
1.3 albertel 29: if (!$value) {
1.4 ! albertel 30: $Apache::inputtags::params{$name}=$default;
1.3 albertel 31: } else {
1.4 ! albertel 32: $Apache::inputtags::params{$name}=$value;
1.3 albertel 33: }
34: return '';
35: }
36:
37: sub end_responseparam {
1.1 albertel 38: }
1.2 albertel 39:
1.1 albertel 40: 1;
41: __END__
42:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>