version 1.32, 2001/06/29 18:53:50
|
version 1.34, 2001/07/13 16:15:00
|
Line 6 use strict;
|
Line 6 use strict;
|
use capa; |
use capa; |
|
|
sub BEGIN { |
sub BEGIN { |
&Apache::lonxml::register('Apache::caparesponse',('caparesponse','numericalresponse')); |
&Apache::lonxml::register('Apache::caparesponse',('caparesponse','numericalresponse','stringresponse')); |
} |
} |
|
|
sub start_caparesponse { |
sub start_caparesponse { |
Line 58 sub start_numericalresponse {
|
Line 58 sub start_numericalresponse {
|
my $result; |
my $result; |
if ($target eq 'edit') { |
if ($target eq 'edit') { |
$result.=&Apache::edit::tag_start($target,$token,&Apache::lonxml::description($token)); |
$result.=&Apache::edit::tag_start($target,$token,&Apache::lonxml::description($token)); |
$result.=&Apache::edit::text_arg('Answer:','answer',$token). |
$result.=&Apache::edit::text_arg('Answer:','answer',$token); |
&Apache::edit::text_arg('Unit:','unit',$token).'</td></tr><tr><td colspan="3">'; |
if ($token->[1] eq 'numericalresponse') { |
|
$result.=&Apache::edit::text_arg('Unit:','unit',$token) |
|
} else { |
|
$result.=&Apache::edit::text_arg('Type:','type',$token) |
|
} |
|
$result.='</td></tr><tr><td colspan="3">'; |
} elsif ($target eq 'modified') { |
} elsif ($target eq 'modified') { |
my $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval, |
my $constructtag; |
'answer','unit'); |
if ($token->[1] eq 'numericalresponse') { |
if ($constructtag) { $result = &Apache::edit::rebuild_tag($token);} |
$constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval, |
|
'answer','unit'); |
|
} else { |
|
$constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval, |
|
'answer','type'); |
|
} |
|
if ($constructtag) { |
|
$result = &Apache::edit::rebuild_tag($token); |
|
$result.=&Apache::edit::handle_insert(); |
|
} |
} |
} |
return $result; |
return $result; |
} |
} |
Line 123 sub end_numericalresponse {
|
Line 137 sub end_numericalresponse {
|
return $result; |
return $result; |
} |
} |
|
|
|
sub start_stringresponse { |
|
return start_numericalresponse(@_); |
|
} |
|
|
|
sub end_stringresponse { |
|
return end_numericalresponse(@_); |
|
} |
|
|
1; |
1; |
__END__ |
__END__ |
|
|