version 1.31, 2001/06/02 03:59:59
|
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 55 sub end_caparesponse {
|
Line 55 sub end_caparesponse {
|
sub start_numericalresponse { |
sub start_numericalresponse { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my $id = &Apache::response::start_response($parstack,$safeeval); |
my $id = &Apache::response::start_response($parstack,$safeeval); |
return ''; |
my $result; |
|
if ($target eq 'edit') { |
|
$result.=&Apache::edit::tag_start($target,$token,&Apache::lonxml::description($token)); |
|
$result.=&Apache::edit::text_arg('Answer:','answer',$token); |
|
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') { |
|
my $constructtag; |
|
if ($token->[1] eq 'numericalresponse') { |
|
$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; |
} |
} |
|
|
sub end_numericalresponse { |
sub end_numericalresponse { |
Line 106 sub end_numericalresponse {
|
Line 130 sub end_numericalresponse {
|
chop $result; |
chop $result; |
$result.=" $unit.<br></br>"; |
$result.=" $unit.<br></br>"; |
} |
} |
|
} elsif ($target eq 'edit') { |
|
$result.='</td></tr>'.&Apache::edit::end_table; |
} |
} |
&Apache::response::end_response; |
&Apache::response::end_response; |
return $result; |
return $result; |
} |
} |
|
|
|
sub start_stringresponse { |
|
return start_numericalresponse(@_); |
|
} |
|
|
|
sub end_stringresponse { |
|
return end_numericalresponse(@_); |
|
} |
|
|
1; |
1; |
__END__ |
__END__ |
|
|