version 1.7, 2001/05/15 20:48:43
|
version 1.8, 2001/05/21 19:45:28
|
Line 62 sub end_foilgroup {
|
Line 62 sub end_foilgroup {
|
my $allresponse; |
my $allresponse; |
my $right=0; |
my $right=0; |
my $wrong=0; |
my $wrong=0; |
|
my $ignored=0; |
foreach $name (@whichopt) { |
foreach $name (@whichopt) { |
my $response = $ENV{'form.HWVAL_'.$Apache::inputtags::response['-1'].":$temp"}; |
my $response = $ENV{'form.HWVAL_'.$Apache::inputtags::response['-1'].":$temp"}; |
$allresponse.="$response:"; |
$allresponse.="$response:"; |
Line 69 sub end_foilgroup {
|
Line 70 sub end_foilgroup {
|
&Apache::lonxml::debug("submitted a $response<br />\n"); |
&Apache::lonxml::debug("submitted a $response<br />\n"); |
my $value=$Apache::response::foilgroup{$name.'.value'}; |
my $value=$Apache::response::foilgroup{$name.'.value'}; |
if ($value eq $response) {$right++;} else {$wrong++;} |
if ($value eq $response) {$right++;} else {$wrong++;} |
|
} else { |
|
$ignored++; |
} |
} |
$temp++; |
$temp++; |
} |
} |
my $id = $Apache::inputtags::response['-1']; |
my $id = $Apache::inputtags::response['-1']; |
$Apache::lonhomework::results{"resource.$Apache::inputtags::part.$id.submission"}=$allresponse; |
$Apache::lonhomework::results{"resource.$Apache::inputtags::part.$id.submission"}=$allresponse; |
&Apache::lonxml::debug("Got $right right and $wrong wrong"); |
&Apache::lonxml::debug("Got $right right and $wrong wrong, and $ignored were ignored"); |
if ($wrong==0) { |
if ($wrong==0 && $ignored==0) { |
$Apache::lonhomework::results{"resource.$Apache::inputtags::part.$id.awarddetail"}='EXACT_ANS'; |
$Apache::lonhomework::results{"resource.$Apache::inputtags::part.$id.awarddetail"}='EXACT_ANS'; |
} else { |
} else { |
$Apache::lonhomework::results{"resource.$Apache::inputtags::part.$id.awarddetail"}='INCORRECT'; |
$Apache::lonhomework::results{"resource.$Apache::inputtags::part.$id.awarddetail"}='INCORRECT'; |