version 1.59, 2002/02/14 21:48:31
|
version 1.64, 2002/09/26 20:45:00
|
Line 33 package Apache::response;
|
Line 33 package Apache::response;
|
use strict; |
use strict; |
|
|
BEGIN { |
BEGIN { |
&Apache::lonxml::register('Apache::response',('responseparam','parameter','caparesponse','numericalresponse','formularesponse','stringresponse','radiobuttonresponse','optionresponse','imageresponse','essayresponse','dataresponse','externalresponse')); |
&Apache::lonxml::register('Apache::response',('responseparam','parameter')); |
} |
} |
|
|
sub start_response { |
sub start_response { |
Line 62 sub start_hintresponse {
|
Line 62 sub start_hintresponse {
|
my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval); |
my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval); |
if ($id eq '') { $id = $Apache::lonxml::curdepth; } |
if ($id eq '') { $id = $Apache::lonxml::curdepth; } |
push (@Apache::inputtags::response,$id); |
push (@Apache::inputtags::response,$id); |
|
push (@Apache::inputtags::paramstack,[%Apache::inputtags::params]); |
return $id; |
return $id; |
} |
} |
|
|
sub end_hintresponse { |
sub end_hintresponse { |
pop @Apache::inputtags::response; |
pop @Apache::inputtags::response; |
|
%Apache::inputtags::params=@{pop(@Apache::inputtags::paramstack)}; |
return ''; |
return ''; |
} |
} |
|
|
Line 89 sub setrandomnumber {
|
Line 91 sub setrandomnumber {
|
$rndseed=$rndseed |
$rndseed=$rndseed |
+&Apache::lonnet::numval($Apache::inputtags::response['-1']); |
+&Apache::lonnet::numval($Apache::inputtags::response['-1']); |
} |
} |
srand($rndseed); |
&Math::Random::random_set_seed_from_phrase($rndseed); |
&Apache::lonxml::debug("randseed $rndseed"); |
&Apache::lonxml::debug("randseed $rndseed"); |
return ''; |
return ''; |
} |
} |
Line 205 sub handle_previous {
|
Line 207 sub handle_previous {
|
} |
} |
} |
} |
|
|
sub start_caparesponse { |
|
require Apache::caparesponse; |
|
import Apache::caparesponse; |
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
|
# print "\n<br />\nsimple caparesponse\n"; |
|
return &Apache::caparesponse::start_caparesponse($target,$token,$tagstack,$parstack,$parser,$safeeval,$style); |
|
} |
|
|
|
sub start_stringresponse { |
|
require Apache::caparesponse; |
|
import Apache::caparesponse; |
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
|
return &Apache::caparesponse::start_stringresponse($target,$token,$tagstack,$parstack,$parser,$safeeval,$style); |
|
} |
|
|
|
sub start_formularesponse { |
|
require Apache::caparesponse; |
|
import Apache::caparesponse; |
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
|
return &Apache::caparesponse::start_formularesponse($target,$token,$tagstack,$parstack,$parser,$safeeval,$style); |
|
} |
|
|
|
sub start_numericalresponse { |
|
require Apache::caparesponse; |
|
import Apache::caparesponse; |
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
|
return &Apache::caparesponse::start_numericalresponse |
|
($target,$token,$tagstack,$parstack,$parser,$safeeval,$style); |
|
} |
|
|
|
sub start_radiobuttonresponse { |
|
require Apache::radiobuttonresponse; |
|
import Apache::radiobuttonresponse; |
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
|
return &Apache::radiobuttonresponse::start_radiobuttonresponse($target,$token,$tagstack,$parstack,$parser,$safeeval,$style); |
|
} |
|
|
|
sub start_optionresponse { |
|
require Apache::optionresponse; |
|
import Apache::optionresponse; |
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
|
return &Apache::optionresponse::start_optionresponse($target,$token,$tagstack,$parstack,$parser,$safeeval,$style); |
|
} |
|
|
|
sub start_imageresponse { |
|
require Apache::imageresponse; |
|
import Apache::imageresponse; |
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
|
return &Apache::imageresponse::start_imageresponse($target,$token,$tagstack,$parstack,$parser,$safeeval,$style); |
|
} |
|
|
|
sub start_essayresponse { |
|
require Apache::essayresponse; |
|
import Apache::essayresponse; |
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
|
return &Apache::essayresponse::start_essayresponse($target,$token,$tagstack,$parstack,$parser,$safeeval,$style); |
|
} |
|
|
|
sub start_externalresponse { |
|
require Apache::externalresponse; |
|
import Apache::externalresponse; |
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
|
return &Apache::externalresponse::start_externalresponse($target,$token,$tagstack,$parstack,$parser,$safeeval,$style); |
|
} |
|
|
|
sub view_or_modify { |
sub view_or_modify { |
my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser(); |
my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser(); |
my $myself=0; |
my $myself=0; |
Line 356 sub start_responseparam {
|
Line 293 sub start_responseparam {
|
$result = &Apache::edit::rebuild_tag($token); |
$result = &Apache::edit::rebuild_tag($token); |
$result.=&Apache::edit::handle_insert(); |
$result.=&Apache::edit::handle_insert(); |
} |
} |
} elsif ($target eq 'grade' || $target eq 'answer' ) { |
} elsif ($target eq 'grade' || $target eq 'answer' || |
|
$target eq 'web' || $target eq 'tex') { |
if ($ENV{'request.state'} eq 'construct') { |
if ($ENV{'request.state'} eq 'construct') { |
my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval); |
my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval); |
my $default = &Apache::lonxml::get_param('default',$parstack,$safeeval); |
my $default = &Apache::lonxml::get_param('default',$parstack,$safeeval); |
$Apache::inputtags::params{$name}=$default; |
if ($name) {$Apache::inputtags::params{$name}=$default;} |
} |
} |
} |
} |
return $result; |
return $result; |
Line 386 sub setup_params {
|
Line 324 sub setup_params {
|
my ($tag) = @_; |
my ($tag) = @_; |
|
|
if ($ENV{'request.state'} eq 'construct') { return; } |
if ($ENV{'request.state'} eq 'construct') { return; } |
@Apache::inputtags::params=(); |
%Apache::inputtags::params=(); |
my %paramlist=(); |
my %paramlist=(); |
foreach my $key (keys(%Apache::lonnet::packagetab)) { |
foreach my $key (keys(%Apache::lonnet::packagetab)) { |
if ($key =~ /^$tag/) { |
if ($key =~ /^$tag/) { |
Line 448 sub answer_footer {
|
Line 386 sub answer_footer {
|
return $result; |
return $result; |
} |
} |
|
|
|
sub showallfoils { |
|
my $return=0; |
|
if (defined($ENV{'form.showallfoils'}) && |
|
$ENV{'request.state'} eq 'construct') { |
|
$return=1; |
|
} |
|
return $return; |
|
} |
1; |
1; |
__END__ |
__END__ |
|
|