version 1.90, 2004/02/09 19:38:00
|
version 1.93, 2004/03/08 22:59:12
|
Line 28
|
Line 28
|
|
|
package Apache::response; |
package Apache::response; |
use strict; |
use strict; |
|
use Apache::lonlocal; |
|
|
BEGIN { |
BEGIN { |
&Apache::lonxml::register('Apache::response',('responseparam','parameter','dataresponse')); |
&Apache::lonxml::register('Apache::response',('responseparam','parameter','dataresponse')); |
Line 45 sub start_response {
|
Line 46 sub start_response {
|
push (@Apache::inputtags::response,$id); |
push (@Apache::inputtags::response,$id); |
push (@Apache::inputtags::responselist,$id); |
push (@Apache::inputtags::responselist,$id); |
@Apache::inputtags::inputlist=(); |
@Apache::inputtags::inputlist=(); |
|
if ($Apache::inputtags::part eq '') { |
|
&Apache::lonxml::error(&HTML::Entities::encode(&mt("Found a <*response> outside of a <part> in a <part>ed problem"))); |
|
} |
|
if ($Apache::inputtags::response_with_no_part && |
|
$Apache::inputtags::part ne '0') { |
|
&Apache::lonxml::error(&HTML::Entities::encode(&mt("<*response>s are both inside of <part> and outside of <part>, this is not a valid problem, errors in grading may occur.")).'<br />'); |
|
} |
|
if ($Apache::inputtags::part eq '0') { |
|
$Apache::inputtags::response_with_no_part=1; |
|
} |
return $id; |
return $id; |
} |
} |
|
|
Line 502 sub scored_response {
|
Line 513 sub scored_response {
|
if ($increase ne '') { $score+=$increase+1; } |
if ($increase ne '') { $score+=$increase+1; } |
} |
} |
my $weight = &Apache::lonnet::EXT("resource.$part.weight"); |
my $weight = &Apache::lonnet::EXT("resource.$part.weight"); |
|
if (!defined($weight) || $weight eq '' || $weight eq 0) { $weight = 1; } |
my $pcr=$score/$weight; |
my $pcr=$score/$weight; |
$Apache::lonhomework::results{"resource.$part.$id.awarded"}=$pcr; |
$Apache::lonhomework::results{"resource.$part.$id.awarded"}=$pcr; |
$Apache::lonhomework::results{"resource.$part.$id.awarddetail"}= |
$Apache::lonhomework::results{"resource.$part.$id.awarddetail"}= |