version 1.68, 2002/11/27 19:25:56
|
version 1.70, 2003/04/08 02:42:55
|
Line 68 sub start_hintresponse {
|
Line 68 sub start_hintresponse {
|
|
|
sub end_hintresponse { |
sub end_hintresponse { |
pop @Apache::inputtags::response; |
pop @Apache::inputtags::response; |
%Apache::inputtags::params=@{pop(@Apache::inputtags::paramstack)}; |
if (defined($Apache::inputtags::paramstack[-1])) { |
|
%Apache::inputtags::params= |
|
@{ pop(@Apache::inputtags::paramstack) }; |
|
} |
return ''; |
return ''; |
} |
} |
|
|
Line 250 sub end_dataresponse {
|
Line 253 sub end_dataresponse {
|
&Apache::response::setup_params('dataresponse'); |
&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}; |
my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval); |
my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval); |
if ( $response =~ /[^\s]/) { |
if ( $response =~ /[^\s]/) { |
$Apache::lonhomework::results{"resource.$partid.$id.$name"}= |
$Apache::lonhomework::results{"resource.$partid.$id.$name"}= |
Line 399 sub showallfoils {
|
Line 402 sub showallfoils {
|
} |
} |
return $return; |
return $return; |
} |
} |
|
|
|
sub getresponse { |
|
my ($temp)=@_; |
|
my $formparm='form.HWVAL_'.$Apache::inputtags::response['-1']; |
|
my $response; |
|
if (!defined($temp)) { |
|
$temp=1; |
|
} else { |
|
$formparm.=":$temp"; |
|
} |
|
my %let_to_num=('A'=>0,'B'=>1,'C'=>2,'D'=>3,'E'=>4,'F'=>5,'G'=>6,'H'=>7, |
|
'I'=>8,'J'=>9,'K'=>10,'L'=>11,'M'=>12,'N'=>13,'O'=>14, |
|
'P'=>15,'Q'=>16,'R'=>17,'S'=>18,'T'=>19,'U'=>20,'V'=>21, |
|
'W'=>22,'X'=>23,'Y'=>24,'Z'=>25); |
|
if ($ENV{'form.submitted'} eq 'scantron') { |
|
$response = $ENV{'scantron.'.($Apache::lonxml::counter+$temp-1). |
|
'.answer'}; |
|
$response = $let_to_num{$response}; |
|
} else { |
|
$response = $ENV{$formparm}; |
|
} |
|
return $response; |
|
} |
1; |
1; |
__END__ |
__END__ |
|
|