--- loncom/homework/optionresponse.pm 2003/03/26 22:59:09 1.70
+++ loncom/homework/optionresponse.pm 2003/04/07 22:28:08 1.74
@@ -1,7 +1,7 @@
# LearningOnline Network with CAPA
# option list style responses
#
-# $Id: optionresponse.pm,v 1.70 2003/03/26 22:59:09 albertel Exp $
+# $Id: optionresponse.pm,v 1.74 2003/04/07 22:28:08 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -185,7 +185,10 @@ sub end_foilgroup {
my $wrong=0;
my $ignored=0;
foreach $name (@whichopt) {
- my $response = $ENV{'form.HWVAL_'.$Apache::inputtags::response['-1'].":$temp"};
+ my $response=&Apache::response::getresponse($temp);
+ if ($ENV{'form.submitted'} eq 'scantron') {
+ $response = $opt[$response];
+ }
$responsehash{$name}=$response;
if ( $response =~ /[^\s]/) {
my $value=$Apache::response::foilgroup{$name.'.value'};
@@ -227,10 +230,13 @@ sub end_foilgroup {
&Apache::response::handle_previous(\%previous,$ad);
}
}
+ &Apache::lonxml::increment_counter(&getfoilcounts($max));
} elsif ($target eq 'edit') {
$result.=&Apache::edit::end_table();
- }
- if ($target eq 'tex' and $Apache::lonhomework::type ne 'exam') {$result .= '\end{enumerate}';}
+ }
+ if ($target eq 'tex' and $Apache::lonhomework::type ne 'exam') {
+ $result .= '\end{enumerate}';
+ }
return $result;
}
@@ -316,8 +322,7 @@ sub displayfoils {
my $result;
my $name;
my $displayoptionintex=0;
- my @alphabet = ('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P',
- 'Q','R','S','T','U','V','W','X','Y','Z');
+ my @alphabet = ('A'..'Z');
my @whichopt = &whichfoils($max,$randomize);
my $part=$Apache::inputtags::part;
my $id=$Apache::inputtags::response[-1];
@@ -383,16 +388,18 @@ sub displayfoils {
}
}
if ($target ne 'tex') {
- $optionlist='\n";
+ }
my $text=$Apache::response::foilgroup{$name.'.text'};
- if (!($text=~s|
'.$alphabet[$ind].': '.$opt[$ind].' | '; + $result.=''.$alphabet[$ind].': '.$opt[$ind].' | '; } $result.='