version 1.62, 2002/05/03 19:32:57
|
version 1.67, 2002/11/25 21:36:42
|
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','dataresponse')); |
} |
} |
|
|
sub start_response { |
sub start_response { |
Line 91 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 207 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 310 sub end_dataresponse {
|
Line 245 sub end_dataresponse {
|
my ($symb,$courseid,$domain,$name)=&Apache::lonxml::whichuser(); |
my ($symb,$courseid,$domain,$name)=&Apache::lonxml::whichuser(); |
my $allowed=&Apache::lonnet::allowed('mgr',$courseid); |
my $allowed=&Apache::lonnet::allowed('mgr',$courseid); |
if ($allowed) { |
if ($allowed) { |
&Apache::response::setup_params('datasubmission'); |
&Apache::response::setup_params('dataresponse'); |
my $partid = $Apache::inputtags::part; |
my $partid = $Apache::inputtags::part; |
my $id = $Apache::inputtags::response['-1']; |
my $id = $Apache::inputtags::response['-1']; |
my $response = $ENV{'form.HWVAL'.$id}; |
my $response = $ENV{'form.HWVAL'.$id}; |
Line 358 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 'web' || $target eq 'tex') { |
$target eq 'tex' || $target eq 'analyze' ) { |
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); |
Line 385 sub end_parameter {
|
Line 320 sub end_parameter {
|
return $result; |
return $result; |
} |
} |
|
|
|
sub reset_params { |
|
%Apache::inputtags::params=(); |
|
} |
|
|
sub setup_params { |
sub setup_params { |
my ($tag) = @_; |
my ($tag) = @_; |
|
|
if ($ENV{'request.state'} eq 'construct') { return; } |
if ($ENV{'request.state'} eq 'construct') { return; } |
%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/) { |