File:
[LON-CAPA] /
loncom /
homework /
response.pm
Revision
1.5:
download - view:
text,
annotated -
select for diffs
Thu Nov 23 17:24:39 2000 UTC (23 years, 8 months ago) by
www
Branches:
MAIN
CVS tags:
HEAD
The responseparam tag now has output for target meta, which will be used
by the RAT and lonparmset to determine which parameters (in addition to the
standard ones) the problem has. The output should be
<parameter_part#_name display="description">type</parameter_part#_name>
1: # The LearningOnline Network with CAPA
2: # various response type definitons response definition
3:
4: # 11/23 Gerd Kortemeyer
5:
6: package Apache::response;
7: use strict;
8:
9: sub BEGIN {
10: &Apache::lonxml::register('Apache::response',('responseparam','caparesponse'));
11: }
12:
13: sub start_caparesponse {
14: require Apache::caparesponse;
15: import Apache::caparesponse;
16: my ($target,$token,$parstack,$parser,$safeeval,$style)=@_;
17: # print "\n<br>\nsimple caparesponse\n";
18: Apache::caparesponse::start_caparesponse($target,$token,$parstack,$parser,$safeeval,$style);;
19: return "";
20: }
21:
22: sub start_responseparam {
23: my ($target,$token,$parstack,$parser,$safeeval)=@_;
24: if ($target ne 'meta') {
25: my $args='';
26: if ( $#$parstack > -1 ) { $args=$$parstack[$#$parstack]; }
27: my $default = &Apache::run::run("{$args;".'return $default}',$safeeval);
28: my $name = &Apache::run::run("{$args;".'return $name}',$safeeval);
29: &Apache::lonxml::debug("looking for resource.$Apache::inputtags::part['-1'].$name");
30: my $value = &Apache::lonnet::EXT("resource.$Apache::inputtags::part['-1'].$name");
31: &Apache::lonxml::debug("$name has value :$value: and default :$default:");
32: if (!$value) {
33: $Apache::inputtags::params{$name}=$default;
34: } else {
35: $Apache::inputtags::params{$name}=$value;
36: }
37: return '';
38: } else {
39: my $tag='parameter_'.$Apache::inputtags::part['-1'].'_'.
40: $token->[2]->{'name'};
41: my $display='';
42: if ($token->[2]->{'description'}) {
43: $display=' display="'.$token->[2]->{'description'}.'"';
44: }
45: return "\n<".$tag.$display.'>'.$token->[2]->{'type'}.'</'.$tag.'>';
46: }
47: }
48:
49: sub end_responseparam {
50: }
51:
52: 1;
53: __END__
54:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>